EASYAIuniappNewUI/node_modules/licia/evalJs.js
2025-02-08 18:50:38 +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;