Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Method after closing curly brace #54

Closed
karaby opened this issue Nov 20, 2020 · 3 comments
Closed

Method after closing curly brace #54

karaby opened this issue Nov 20, 2020 · 3 comments
Labels

Comments

@karaby
Copy link

karaby commented Nov 20, 2020

Bug:
No dot is placed in front of the method if there is a closing curly brace before it.
Sample
source:
for(var aD in aA)I['d'](aC,aD,function(aE){return aA[aE];}['bind'](null,aD));
result:

for (var aD in aA) I.d(aC, aD, function (aE) {
        return aA[aE];
    }
    bind(null, aD));

Used master branch, commit 7b46556

@lelinhtinh lelinhtinh added the bug label Nov 20, 2020
@lelinhtinh
Copy link
Owner

But, how to distinguish it with the class structure? 🤦

class Test {
  ["ahihi"]() {
    return function () {
      return 1;
    };
  }
  ["bind"]() {
    return 2;
  }
}

@karaby
Copy link
Author

karaby commented Nov 20, 2020

And in this case ("Of inherits", "Of transformTo")?
before:

                Ob['magic'] = String['fromCharCo' + 'de'](0x8, 0x0),
                Of['inherits'](Oi, Og),
                Oi['prototype']['processChu' + 'nk'] = function(On) {
                    this['meta'] = On['meta'],
                    null === this['_pako'] && this['_createPak' + 'o'](),
                    this['_pako']['push'](Of['transformT' + 'o'](Oh, On['data']), !0x1);
                }

after:

                    Ob.magic = String.fromCharCode(8, 0), Of inherits(Oi, Og), Oi.prototype.processChunk = function (On) {
                        this.meta = On.meta, null === this._pako && this._createPako(), this._pako.push(Of transformTo(Oh, On.data), false);

@lelinhtinh
Copy link
Owner

/(?<=(\b(return|throw|in|of|new|delete|default|function|async|await|get|set)|\{|\}|\*))\s*\[('|")((?![\d\W])[\w$]*)\3\]\s*\(/gi,

Just remove the i flag

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants