This commit is contained in:
Winston Chang
2017-08-18 17:19:08 -05:00
parent 1f864a846f
commit e2d19cbaba
4 changed files with 8 additions and 7 deletions

View File

@@ -179,7 +179,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
// "with" on the argument value, and return the result.
function scopeExprToFunc(expr) {
/*jshint evil: true */
var expr_escaped = expr.replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
var expr_escaped = expr.replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0').replace(/\n/g, '\\n');
try {
var func = new Function('with (this) {\n try {\n return (' + expr + ');\n } catch (e) {\n console.error(\'Error evaluating expression: ' + expr_escaped + '\');\n throw e;\n }\n }');
} catch (e) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long