Skip to content

Commit

Permalink
Merge pull request #7 from mrx23dot/oldjs
Browse files Browse the repository at this point in the history
fixed support for old JS
  • Loading branch information
tintinweb authored Feb 10, 2022
2 parents 02c57c7 + fc333ff commit 59422f1
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 59422f1

Please sign in to comment.