You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
363 B
17 lines
363 B
2 years ago
|
var root = require('./root');
|
||
|
exports = function(js, ctx) {
|
||
|
ctx = ctx || root;
|
||
|
|
||
|
try {
|
||
|
return new Function('return (' + js + ');').call(ctx);
|
||
|
} catch (e) {
|
||
|
try {
|
||
|
return new Function('return ' + js).call(ctx);
|
||
|
} catch (e) {
|
||
|
return new Function(js).call(ctx);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
module.exports = exports;
|