setImmediate in node-webkit

1 view
Skip to first unread message

Stefan Thomas

unread,
Jul 18, 2013, 6:14:53 PM7/18/13
to node-...@googlegroups.com
I'm not sure if this is a bug, but I think so.

Expected behavior: node-webkit copies setImmediate over from Node.js global to window.

Actual behavior: It doesn't:

> setImmediate
ReferenceError: setImmediate is not defined

> global.setImmediate
function () {
   var t = NativeModule.require('timers');
   return t.setImmediate.apply(this, arguments);
}


What makes this particularly irritating is that the setImmediate shim provided by NobleJS is fooled by "global.setImmediate" and doesn't trigger.

https://github.com/NobleJS/setImmediate

So ultimately you end up with no setImmediate at all, even if your app includes the shim.
Reply all
Reply to author
Forward
0 new messages