Skip to content

Commit

Permalink
codegen: check if func exists in rhemyn
Browse files Browse the repository at this point in the history
test262: 11.17% | πŸ§ͺ 49377 | 🀠 5513 | ❌ 1256 | πŸ’€ 8656 | 🧩 2478 | πŸ’₯ 1551 (-303) | ⏰ 1 | πŸ“ 29922 (+303)
  • Loading branch information
CanadaHonk committed Feb 12, 2024
1 parent 4035760 commit c671f9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/codeGen.js
Original file line number Diff line number Diff line change
Expand Up @@ -1473,8 +1473,8 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
// literal.func()
if (!name && decl.callee.type === 'MemberExpression') {
// megahack for /regex/.func()
if (decl.callee.object.regex) {
const funcName = decl.callee.property.name;
const funcName = decl.callee.property.name;
if (decl.callee.object.regex && Object.hasOwn(Rhemyn, funcName)) {
const func = Rhemyn[funcName](decl.callee.object.regex.pattern, currentFuncIndex++);

funcIndex[func.name] = func.index;
Expand Down

0 comments on commit c671f9c

Please sign in to comment.