You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.
$ node test.js
v7.2.1
OK
$ n use 0.10.40 test.js
v0.10.40
OK
$ jx test.js
v0.10.40
assert.js:105
throw new assert.AssertionError({
^
AssertionError: "function () {}" == "function () {\n var t = NativeModule.require('timers');\n return t.setTimeout.apply(this, arguments);\n }"
at Object.<anonymous> (/home/tmp/Thali_CordovaPlugin/test/www/jxcore/test1.js:6:8)
at Module._compile (module.js:619:26)
at Object.Module._extensions..js (module.js:649:10)
at Module.load (module.js:440:36)
at Function.Module._load (module.js:405:12)
at Function.Module.runMain (module.js:878:12)
at startup (node.js:492:18)
at node.js:1611:3
I've discovered it when trying to use sinon's fake timers. They simply doesn't work in jxcore. It affects at least setTimeout and setInterval functions. Other global variables (like Date, Number, setImmediate) are fine.
I'm not sure about priority of this bug. I had to changesetTimeout to global.setTimeout everywhere in my code in order to make everything work. So for now I can use this workaround.
The text was updated successfully, but these errors were encountered:
// TODO(obastemur) check ION again and remove the below hack or fix it.// -- I personally suspect ION skips it mostly because of multiple references// to globals?//// experimental hack// ionSpew may skip ION compilation when there is a global member used.// sending the popular references: setTimeout, setInterval, and processvarargs=[self.exports,require,self,filename,dirname,global.setTimeout,global.setInterval,global.process];returncompiledWrapper.apply(self.exports,args);
Test case:
Output:
I've discovered it when trying to use sinon's fake timers. They simply doesn't work in jxcore. It affects at least
setTimeout
andsetInterval
functions. Other global variables (likeDate
,Number
,setImmediate
) are fine.I'm not sure about priority of this bug. I had to change
setTimeout
toglobal.setTimeout
everywhere in my code in order to make everything work. So for now I can use this workaround.The text was updated successfully, but these errors were encountered: