uni-ticket-system/node_modules/licia/evalJs.js
2023-12-05 10:11:10 +08:00

17 lines
363 B
JavaScript

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;