New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorator proposal plugin causes Stack overflow with super() #8808

Open
TechQuery opened this Issue Oct 3, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@TechQuery

TechQuery commented Oct 3, 2018

Bug Report

Current Behavior

./test-project/node_modules/@babel/types/lib/converters/toIdentifier.js:14
  name = name.replace(/[^a-zA-Z0-9$_]/g, "-");
              ^

RangeError: Maximum call stack size exceeded
    at String.replace (<anonymous>)
    at Object.toIdentifier (./test-project/node_modules/@babel/types/lib/converters/toIdentifier.js:14:15)
    at Scope.generateUid (./test-project/node_modules/@babel/traverse/lib/scope/index.js:262:16)
    at Scope.generateUidIdentifier (./test-project/node_modules/@babel/traverse/lib/scope/index.js:258:32)
    at Scope.generateDeclaredUidIdentifier (./test-project/node_modules/@babel/traverse/lib/scope/index.js:250:21)
    at NodePath.insertAfter (./test-project/node_modules/@babel/traverse/lib/path/modification.js:121:26)
    at Object.CallExpression (./test-project/node_modules/@babel/plugin-proposal-decorators/lib/transformer.js:143:12)
    at NodePath._call (./test-project/node_modules/@babel/traverse/lib/path/context.js:53:20)
    at NodePath.call (./test-project/node_modules/@babel/traverse/lib/path/context.js:40:17)
    at NodePath.visit (./test-project/node_modules/@babel/traverse/lib/path/context.js:88:12)

Input Code

@decorator( parameter )
class Sub extends Super {
    constructor() {  super().method();  }    //  To remove `.method()` will fix it...
}

Expected behavior/code

Compile correctly.

Babel Configuration (package.json)

{
  "babel": {
    "presets": [
      "@babel/preset-env"
    ],
    "plugins": [
      [
        "@babel/plugin-proposal-decorators",
        {
          "decoratorsBeforeExport": true
        }
      ]
    ]
  }
}

Environment

  • Babel version(s): v7.1.2
  • Node/npm version: v8.11.2 / v5.6.0
  • OS: Windows 10 Pro 1803
  • How you are using Babel: CLI
@babel-bot

This comment has been minimized.

Show comment
Hide comment
@babel-bot

babel-bot Oct 3, 2018

Collaborator

Hey @TechQuery! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

Collaborator

babel-bot commented Oct 3, 2018

Hey @TechQuery! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment