loaders
loaders copied to clipboard
Function constructor does not honor experimental-{strip,transform}-types
$ node --experimental-transform-types -e 'new Function(`console.log("hi" as 3)`)()'
undefined:3
console.log("hi" as 3)
^^^^
SyntaxError: missing ) after argument list
The ECMAScript spec prevents runtimes from intercepting the code passed to new Function. Modules can be anything, but eval and new Function can only evaluate JS.