Yes and No, it depends on where the code is and how it is executed.
No, if the code is embedded in the code of the web page, just the browser is required because javascript doesn't need another application to run it . JavaScript is running as an integral part of the browser, so there is no call made to the file associations for the associated file to run the script.
Yes if it is a file (ascript.js) on your HDD and you double click it, it would require a runtime file to execute the script, so ScriptTrap can and does intercept that, see image.