Sunday, 15 March 2015

javascript - setTimeout not working in SpiderMonkey -



javascript - setTimeout not working in SpiderMonkey -

i have built spidermonkey on mac next this. under build-release/dist/bin executable js24 instead of js ( accoring this ).

however, when run shell using js24, expressions 1+2 working, when seek things settimeout(function () {}, 500) getting,

referenceerror: settimeout not defined

what doing wrong ? thought behaviour same node shell.

saving first-class answers comments actual answer, question can marked answered.

settimeout not part of javascript language, it's part of browser's window object, global object web page's javascript code: https://developer.mozilla.org/en-us/docs/web/api/windowtimers.settimeout

node.js has similar api: http://nodejs.org/docs/latest/api/timers.html#timers_settimeout_callback_delay_arg

to implement settimeout in spidermonkey can utilize code: https://gist.github.com/kevinoid/3146420

javascript mozilla spidermonkey

No comments:

Post a Comment