Bug Report
Expected Behavior
Static class fields can't be named constructor. We already disable it for instance fields.
Input Code
- REPL or Repo link if applicable:
class A {
static constructor;
}
repl
Specification: https://tc39.es/proposal-static-class-features/#sec-static-semantics-early-errors
If anyone wants to work on this issue, please leave a comment below! If you need any help, plase ask me (or to any other Babel team member) on Slack 🙂
If you don't know how to clone Babel, follow these steps: (you need to have make and yarn available on your machine).
- Fork the repo
- Run
git clone https://github.com/<YOUR_USERNAME>/babel.git && cd babel
- Run
yarn && make bootstrap
- Wait ⏳
- Run
make watch (or make build whenever you change a file)
- Add a test in
packages/babel-parser/test/fixtures/experimental/class-properties (you can take the no-ctor test in the same folder as an example)
- Update the code!
yarn jest parser to run the tests
- If it is working, run
make test to run all the tests
- Note: this change will likely also impact the results of running the Test262 suite on Babel.
- Before running those tests you need to run
make bootstrap-test262 to download them
- Use
make test-test262 to run them
- If some tests which were previously failing now pass, you can run
make test-test262-update-whitelist
- Run
git push and open a PR!
Tip: if you don't know where to start from, try to Ctrl+F for the error generated by non-static fields named constructor! 😄
Bug Report
Expected Behavior
Static class fields can't be named
constructor. We already disable it for instance fields.Input Code
repl
Specification: https://tc39.es/proposal-static-class-features/#sec-static-semantics-early-errors
If anyone wants to work on this issue, please leave a comment below! If you need any help, plase ask me (or to any other Babel team member) on Slack 🙂
If you don't know how to clone Babel, follow these steps: (you need to have
makeandyarnavailable on your machine).git clone https://github.com/<YOUR_USERNAME>/babel.git && cd babelyarn && make bootstrapmake watch(ormake buildwhenever you change a file)packages/babel-parser/test/fixtures/experimental/class-properties(you can take theno-ctortest in the same folder as an example)yarn jest parserto run the testsmake testto run all the testsmake bootstrap-test262to download themmake test-test262to run themmake test-test262-update-whitelistgit pushand open a PR!Tip: if you don't know where to start from, try to Ctrl+F for the error generated by non-static fields named
constructor! 😄