Skip to content

Commit

Permalink
fixed support for old JS
Browse files Browse the repository at this point in the history
  • Loading branch information
arpadatscorp committed Feb 9, 2022
1 parent 02c57c7 commit fc333ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules/builtin.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class GenericGrep extends BaseRule {
if (p.includes("{") || p.includes("}") || p.includes("function ") || p.includes("class ") || p.includes("this.") || p.includes("async") || p.includes("require") || p.includes("\n")) {
throw new Error("Invalid pattern: " + p);
}
return p.replaceAll(remapFunction, '_function.')
return p.replace(remapFunction, '_function.')

}).filter(p => p.length > 0);
}
Expand Down Expand Up @@ -101,7 +101,7 @@ class GenericGrep extends BaseRule {
// Modifier
//update context
context.modifier = _modifier;

if (patternType === "modifier") {
let ret = safeEval(pat, context);
if (ret) {
Expand Down

0 comments on commit fc333ff

Please sign in to comment.