godmodelabs / ejecta-v8

A port of @phoboslabs EjectaJS which uses v8 instead of JavaScriptCore.
http://godmodelabs.github.io/ejecta-v8/
84 stars 16 forks source link

Fixes crash in timer. #37

Closed bjaekel closed 4 years ago

bjaekel commented 4 years ago

FIxes error in setTimer and setInterval call in JavaScript. An example for the crash can be:

consolo.log('setting up a timer'); let timeoutId; timeoutId = setTimeout(function() { consolo.log('timeout executed, but calling clearTimeout()'); clearTimeout(timeoutId); consolo.log('after timeout executed.'); }, 1000);

consolo.log('setting up a timer'); let timeoutId; timeoutId = setInterval(function() { consolo.log('timeout executed, but calling clearTimeout()'); clearTimeout(timeoutId); consolo.log('after timeout executed.'); }, 1000);

Usefull information: