njs
njs copied to clipboard
eval() support (strict only mode).
the main problem there will be indirect calls:
$ node --use-strict
> .editor
// Entering editor mode (^D to finish, ^C to cancel)
var x = 'global';
var gthis = this;
var scope = function() {
var x = 'local';
eval('console.log(1, x)');
eval('var x; console.log(2, x)');
(null,eval)('console.log(3, x)');
var y = eval;
y('console.log(4, x)');
gthis.eval('console.log(5, x)');
eval.call(null, 'console.log(6, x)');
eval.bind()('console.log(7, x)');
};
scope();
1 'local'
2 undefined
3 'global'
4 'global'
5 'global'
6 'global'
7 'global'
undefined