Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9eb396b9 authored by Brett Zamir's avatar Brett Zamir
Browse files

Better checking to avoid object creation

parent ef808d34
Branches
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ function JSONPath (opts, obj, expr) { ...@@ -55,7 +55,7 @@ function JSONPath (opts, obj, expr) {
if (opts.autostart !== false) { if (opts.autostart !== false) {
var ret = this.evaluate((objArgs ? opts.json : obj), (objArgs ? opts.path : expr)); var ret = this.evaluate((objArgs ? opts.json : obj), (objArgs ? opts.path : expr));
if (!ret) { if (!ret || typeof reg !== 'object') {
throw {avoidNew: true, value: ret, message: "JSONPath should not be called with 'new'"}; throw {avoidNew: true, value: ret, message: "JSONPath should not be called with 'new'"};
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment