Sneh Khatri
2c68d03bf2
Allow $schema property in json config files ( #14067 )
...
* Fix: Error on property in json config files
* options[] delete moved down
2021-12-28 22:13:14 -05:00
wentout
c59870c526
Mark class prototype as read-only ( #12115 )
...
* initial code 2 fix the issue #2025
* Mark class prototype as read-only
* Update fixtures
* Fix failure
* Update Babel 8 fixtures
* Disable in loose mode
* Update fixtures
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-12-10 21:44:48 +01:00
Nicolò Ribaudo
2d989a983d
Run tests in a native Node.js ESM environment ( #13966 )
2021-12-03 15:32:58 +01:00
Federico Ciardi
66cadea103
Revert "fix: non breaking align options naming" ( #13732 )
...
This reverts commit 51a0caa8a2dac2651856035760413d76fb422d77.
2021-09-04 09:34:41 +02:00
Federico Ciardi
51a0caa8a2
fix: set parserOpts.sourceFilename from root sourceFileName ( #13532 )
...
* Partial #13518
* Update tests
2021-08-19 15:54:53 -04:00
Nicolò Ribaudo
910b1f266f
Archive @babel/plugin-syntax-class-properties ( #13232 )
...
babel/babel-archive@b95d3626ad
2021-04-29 23:56:03 +02:00
Sosuke Suzuki
2521c666f7
Add internal ESLint rule for consistent parser error messages ( #13130 )
2021-04-28 18:21:31 +02:00
Nicolò Ribaudo
b0d83daceb
Resolve .browserslistrc as a project-wide file ( #13028 )
2021-03-25 21:37:42 +01:00
Huáng Jùnliàng
6ee87eea49
[babel 8] fallback targets to "defaults, not ie 11" ( #12989 )
2021-03-23 20:17:16 +01:00
Nicolò Ribaudo
564ca6638f
Set rootMode: "root" in loadPartialConfig ( #13040 )
2021-03-23 20:11:10 +01:00
Nicolò Ribaudo
ea6a438315
Enable external-helpers by default in tests ( #12911 )
...
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
2021-02-26 23:33:26 +01:00
Nicolò Ribaudo
cb404e4776
Add targets and browserslist* options to @babel/core ( #12189 )
2021-02-21 17:09:43 +01:00
Nicolò Ribaudo
31ca15ef58
Support .mjs plugins/presets and async factories ( #12266 )
2021-02-21 17:08:30 +01:00
Huáng Jùnliàng
7fb6048e7c
test: add tests on {parser,generator}Override ( #12740 )
2021-02-02 23:18:41 -05:00
Nicolò Ribaudo
8cf0a757d5
Recover from "missing semicolon" errors ( #12437 )
...
* Recover from "missing semicolon" errors
* Update other tests
* Fix flow
* Fix windows test
* Add back deleted test
2021-02-01 10:08:43 +01:00
Huáng Jùnliàng
eda4130d5e
Tweak helper compilation targets ( #12615 )
...
* refactor: simply browserslists defaults overwriting
When `hasTargets` is `false`, `targets` is always an empty object by definition, `objectToBrowserslist({})` always return `[]` therefore we can remove `objectToBrowserslist`.
* test: apply external-helpers on preset-env test fixtures
* test: add ie 6 to force all transforms in corejs 3, debug, corejs 2 fixtures
* Add ie 6 as targets for test fixtures
2021-01-12 13:09:45 -05:00
Nicolò Ribaudo
6a0e909c13
Don't compile import() in development ( #12288 )
2020-11-18 16:02:02 +01:00
Nicolò Ribaudo
1b90d90fcc
Instantiate presets before plugins ( #11689 )
2020-10-14 19:59:02 +02:00
Devon Govett
ce7b170ab7
Return a list of files that were read from loadPartialConfig ( #11907 )
2020-10-14 19:59:02 +02:00
Huáng Jùnliàng
565cfff486
chore: test against workspace babel/core
2020-08-20 14:51:09 -04:00
Huáng Jùnliàng
4be67fb19a
Ensure import() is not transpiled in babel-core published source ( #11974 )
...
* fix: Ensure `import()` is not transpiled when published
* Update packages/babel-core/test/config-chain.js [skip ci]
2020-08-20 13:31:26 -04:00
Justin Ridgewell
a5bc48661b
Isolated exec tests ( #11531 )
...
* Run exec tests in fresh contexts
* Reevaluate modules in every context
* Cache module code when running tests
* Eliminate weakmap accesses as much as possible
* Remove old multiline usage
* Using bundled polyfill to significantly increase performance
The individual requires for each file were the part that was sooooo slow.
* Drop LRU cache size
* Fixes
* Fix test
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-08-10 18:57:48 -04:00
Vahagn Aharonian
b651a6f6ab
Enable logical assignment by default in @babel/parser ( #11860 ) ( #11869 )
2020-07-29 18:32:12 -04:00
Nicolò Ribaudo
f6c7bf36ce
Allow extending untranspiled classes ( #8656 )
2020-03-16 23:59:15 +01:00
Justin Ridgewell
661ffbd830
Support more node types in generateUidBasedOnNode ( #11260 )
...
* Support more node types in generateUidBasedOnNode
* More nodes
2020-03-14 16:24:50 +01:00
Nicolò Ribaudo
d21e2217d5
Skip newlines around inline #__PURE__ annotations ( #11133 )
...
* Skip newlines around #__PURE__ annotations
* Update tests
2020-02-13 19:16:33 +01:00
Huáng Jùnliàng
fa975bf7cd
polish: throw human-friendly error when item-option pair is in… ( #10969 )
...
* polish: throw human-friendly error when item-option pair is incorrectly unwrapped
* add testcase for plugin
* fix: exclude false positive
* fix: validate should support plugin optionsSourceKind
* Revert "fix: validate should support plugin optionsSourceKind"
* fix: validate plugin object in assertNoUnwrappedItemOptionPairs
* fix flow error
* update test fixtures
* refactor: move to loadDescriptor catch clause
* chore: throw Error instead of builtin ReferenceError
* fix flow errors
* chore: add more test cases
2020-01-20 21:05:07 +01:00
Yordis Prieto
4c28f54152
Add babelrc.json support ( #10783 )
...
* Add babelrc.json support
* Add tests
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-01-10 23:41:42 +01:00
Nicolò Ribaudo
ae06baf22f
Add support for babel.config.mjs and .babelrc.mjs ( #10903 )
...
* Add support for babel.config.mjs and .babelrc.mjs
* Use path.extname
2020-01-10 23:14:29 +01:00
Nicolò Ribaudo
282f81bd67
Prepare @babel/core for asynchronicity ( #10507 )
...
* Prepare @babel/core for asynchronicity
* Include regenerator-runtime in standalone build
* Fix rollup build
2020-01-10 22:44:13 +01:00
Abdul Ali
5b907e9bb7
[parser] enable dynamic import by default ( #10843 )
...
* [parser] enable dynamic import by default
* chore: add back babel-core api test
2020-01-10 02:28:52 +01:00
Nicolò Ribaudo
87feda7c2a
@babel/parser error recovery ( #10363 )
...
* Add error recovery support to @babel/parser
* Update @babel/parser tests to always recover from errors
* Update this.raise usage in @babel/parser:
- expression.js
- lval.js
- statement.js
- estree.js
- flow.js
- jsx/index.js
- tokenizer/index.js
* Update @babel/parser fixtures with recovered errors
* Fix tests out of @babel/parser
* Do not use try/catch for control flow
* Update invalid fixtures
* Do not report invalid lhs in toAssignable
* Do not validate function id multiple times
* Dedupe reserved await errors
* Remove duplicate errors about strict reserved bindings
* Remove duplicated error about yield/await inside params
* Don't error twice for methods in object patterns
* Don't report invalid super() twice
* Remove dup error about reserved param for expr arrows
* Remove double escapes in migrated tests
* Dedupe errors about invalid escapes in identifiers
* Remove duplicated error about decorated constructor
* Remove duplicated error about spread in flow class
* Don't throw for invalid super usage
* Don't fail for object decorators with stage 2
* Fix flow inexact type errors
* Fix flow
* Fix errors about escapes in keywords (ref: #10455 )
* Update after rebase
* Fix todo
* Remove duplicated error when using += for defaults
* Remove unnecessary throw
* Nit: use ??
2019-11-05 10:15:00 +01:00
Nicolò Ribaudo
bea1b0d0af
Add support for .cjs config files ( #10599 )
...
* Remove duplicate config loading logic and errors
* Add support for .cjs config files
* Add tests
* [tests] Fallback for fs.promises on node 6
2019-11-04 00:24:44 +01:00
Huáng Jùnliàng
d08702c9d2
inputSourceMap should work when it is in an external file ( #10623 )
...
* fix: construct comment block for fromMapFileComment
* add test
* small tweak: redundant capturing group
2019-10-31 16:12:44 -04:00
Devon Govett
3a5e8a8dd4
Add support for babel.config.json ( #10501 )
...
* Add support for babel.config.json root config
* Throw if multiple configuration files are found
* Add tests
2019-10-29 19:37:50 +01:00
Huáng Jùnliàng
dcf7d89b8e
fix: remove filename annotation in buildCodeFrameError ( #10539 )
2019-10-14 18:19:55 +02:00
Huáng Jùnliàng
298c9a6c33
Add filename to transform error ( #10511 )
...
* polish: use “unknown” as a default filename in buildCodeFrameError
* feat: add filename to transform error
* fix: incorrect warning message
* fix: add filename to generate phrase error message
* address review comment from Nicolò
2019-10-01 17:19:29 +02:00
Nicolò Ribaudo
6a5cee8f27
Remove circular dependency ( #10405 )
...
* Remove circular dependency
* Move @babel/runtime test to @babel/runtime
2019-09-08 22:53:42 +02:00
Huáng Jùnliàng
8da9d8b4b8
feat(errors): validate preset when filename is absent ( #10181 )
...
* feat(errors): validate preset when filename is absent
Closes #10154
* fix: test overrides for filename compulsory
* docs: rewrite validate error message
per https://github.com/babel/babel/pull/10181#discussion_r301607986
* polish error message
2019-09-06 18:09:19 +02:00
Nicolò Ribaudo
f0c2364d01
Do not delete "fake" source map comments from strings ( #9960 )
...
Instead of using `convert-source-map`'s `removeComments` method before
parsing the file, we can first parse the file with `@babel/parser` and then
analyze the comments.
This is needed because it is not possible to reliabily detect comments in
JavaScript without fully parsing the file:
https://github.com/thlorenz/convert-source-map/issues/63
2019-08-14 17:05:55 +02:00
Denis Pushkarev
ae9b25ac69
Add to preset-env ES3 transforms for ES3 targets ( #9781 )
...
* add to preset-env ES3 transforms for ES3 targets
* add `transform-reserved-words`
* fix `transform-reserved-words` plugin in `@babel/standalone`
2019-03-30 23:25:12 +01:00
Daniel Tschinder
a559397feb
Move array reference into for head initializer ( #9698 )
...
* Move array reference into for head initializer
* Update packages/babel-plugin-transform-for-of/src/index.js
Co-Authored-By: danez <daniel@tschinder.de>
* Fix tests
2019-03-23 17:57:17 -07:00
Daniel Tschinder
f36a6987e4
Correctly preserve reference to array in for-of loop ( #9697 )
...
* Correctly preserve reference to array in for-of loop
* Add more tests
2019-03-17 21:41:35 -07:00
Nicolò Ribaudo
b8d045f5cf
Update regenerator-transform ( #9558 )
2019-02-21 23:24:31 +01:00
Nicolò Ribaudo
c11cdcb6d8
Fix recursive async function expressions ( #9039 )
...
* Fix recursive async function expressions
* Update fixtures
2018-11-19 17:19:54 +01:00
Nicolò Ribaudo
24c4901ff5
Remove Babylon plugins for features already merged to the ECMAScript spec ( #8448 )
...
These are now enabled by default:
- objectRestSpread (2018)
- asyncGenerators (2018)
- optionalCatchBInding (2019)
- jsonStrings (2019)
TODO (after this commit):
- [ ] Deprecate the `@babel/plugin-syntax-*` packages.
- [ ] Deprecate the `@babel/plugin-proposal-*` packages.
- [ ] Create the `@babel/plugin-transform-*` packages.
2018-11-05 23:48:06 +01:00
Nicolò Ribaudo
38397ce11f
Use toPropertyKey in the "decorate" helper
...
This commit also makes the "toPropertyKey" helper call @@toPrimitive
when needed.
2018-11-02 13:59:57 +01:00
Logan Smyth
79b2af5997
Format fixture JSON with Prettier. ( #8658 )
2018-09-09 17:57:52 -07:00
Logan Smyth
ffa8e6cbae
Allow babel-plugin/preset to be in package names outside the prefix, when used in a scope. ( #8473 )
2018-08-16 15:13:52 -07:00
Henry Zhu
fa86b2ddf0
Remove our own use of stage presets ( #8397 )
...
- also update the stage preset error message/readme's to point to the new blog post
2018-07-28 11:24:53 -04:00