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.
16 lines
363 B
16 lines
363 B
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;
|
|
|