12598 Commits

Author SHA1 Message Date
Brian Ng
57ae306457
Bump flow@0.108.0 (#10516) 2019-10-02 12:13:58 -05:00
David J. Hamilton
fa5a40c8d5 assertNoDuplicates throw with more context (#10419)
When users see errors like

```
Duplicate plugin/preset detected.
If you'd like to use two separate instances of a plugin,
they need separate names, e.g.

  plugins: [
    ['some-plugin', {}],
    ['some-plugin', {}, 'some unique name'],
  ]
```

It can be difficult to determine the source of the conflict, especially
in a larger build system.

This commit outputs what is known about the plugins that actually
conflict, which can be helpful for users to determine the root cause of
the conflict.

Partially addresses #9778
2019-10-02 16:45:03 +02:00
Nicolò Ribaudo
a219b6de7a
Disallow await inside async arrow params (#10469)
* Disallow await inside async arrow params

* Use -1 as default for awaitPos/yieldPos
2019-10-02 07:37:40 +02:00
Huáng Jùnliàng
fa5057f9fb Flow: interface identifier should be declared in the scope (#10220)
* fix: typo

* declare name for flow interface

* add test case for export overload function, typescript

* test: add test

Fixes #10044

* test: update test

* test(flow): add multiple declarations regression test

* re-enable flow test case

# Conflicts:
#	packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/def-site-variance/input.js
#	packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-declare-statements/input.js
#	packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-interfaces-module-and-script/input.js
#	packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-iterator/input.js

* test: disable two flow dupl-decl test

* fix: do not declare name for declare function until we figure out a better way

* test: duplicate declare function and function would not throw
2019-10-02 07:32:42 +02:00
Brian Ng
02f2d17e83 Revert "Try different name for used-by feature again [skip ci]" (#10515)
This reverts commit b351f29033ac109c2140dc6762758ffbf88522c9.
2019-10-01 23:29:04 -04:00
Henry Zhu
b351f29033 Try different name for used-by feature again [skip ci] (#10513) 2019-10-01 21:36:22 +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
80d99b4d4e
Do not allow member expressions to start async arrows (#10332)
* Do not allow member expressions to start async arrows

* Boolean -> boolean
2019-10-01 11:40:42 +02:00
Huáng Jùnliàng
94fcabc4e3 Update test262 whitelist 2019-09-30 11:37:09 -04:00
Huáng Jùnliàng
5f1970433d
chore: only apply lazy cjs module transform on cli and core (#10443) 2019-09-27 16:53:27 -04:00
Nicolò Ribaudo
b459f6a0a4
Add windows to travis (#10249)
* Add windows to travis

* Update

* Do not use sh file on windows

* Fix whitespace

* Unify command

* ./ doesn't work on windows

* Remove all ./ usages

* Run windows test before others

* fix: normalize filename when generating sources

sources should be URL.

* fix: replace normalized path to cwd

* chore: add nodePlatform task options

* fix: normalize preset-env filename output

* chore: replace normalized path to CWD on win32 platform

* limit transform-react-source to run on linux and darwin

* test: escapeRegExp on testcases

* test: add test for babel --filename on windows

* test: double babel-node/cli test timeout

* chore: workaround windows build does not stop

* chore: remove redundant condition

* refactor: rename `nodePlatform` to `os`
2019-09-26 20:59:17 +02:00
Michael J. Currie
66062c2a8c Template literal validation (#10492)
* add template literal validation

* avoid null/undefined error when validating

* simplify validation logic and fix tests

Co-authored-by: Michael J. Currie <michaeljcurrie136@gmail.com>
2019-09-26 19:58:36 +02:00
Phoenix
8d4f95de45 Fix grammar in doc/design/monorepo.md 🤓 (#10496) [skip ci] 2019-09-26 12:37:15 +02:00
Nicolò Ribaudo
d0f093e716
Update test262 whitelist 2019-09-25 02:03:58 +02:00
Gonzalo Rodríguez
490798a26d [parser] Disallow numeric separators in legacy octal like inte… (#10493)
* Disallow numeric separators in lols

* Update whitelist

* Rename test

* Better syntax when checking
2019-09-25 01:32:50 +02:00
Nicolò Ribaudo
eaa1474541
Enable optional chaining and nullish coalescing plugins (#10494)
* Add optional chaining plugin

* Nullish coalescing
2019-09-24 23:11:56 +02:00
Nicolò Ribaudo
0e9502685a
[parser] Don't crash on comment after trailing comma after eli… (#10490) 2019-09-24 17:08:58 +02:00
Huáng Jùnliàng
26be14b24d chore: add access: public where missing (#10489) [skip ci]
* @babel/types
* @babel/plugin-transform-named-capturing-groups-regex
2019-09-24 14:04:54 +02:00
Huáng Jùnliàng
6f3460c767 chore: add access: public to babel parser publish config (#10487) [skip ci] 2019-09-24 10:03:07 +02:00
Corey Farrell
cc080417b9 chore: Upgrade source-map to 0.6.1 (#10446) 2019-09-24 02:01:32 +02:00
Nicolò Ribaudo
a00f371610
Update v7.6.2 changelog [skip ci] 2019-09-23 23:27:03 +02:00
Babel Bot
af66d521bd Add v7.6.2 to CHANGELOG.md [skip ci] 2019-09-23 21:16:32 +00:00
Nicolò Ribaudo
b9cb4af953
v7.6.2 v7.6.2 2019-09-23 23:14:37 +02:00
Gonzalo Rodríguez
69d00dc5b0 [parser] Invalid NonOctal Decimal (#10467)
* Add test

* Add nonOctalDecimal verification

* Update regex and code style

* Refactor non octal detection

* Add numeric separator test

* Disallow numeric separators in non octals

* Update whitelist

* Better test naming

* Disallow numeric separators in non oct for all numbers

* Specific error above the general error

* Add test for invalid leading zero in num separator

* Add start position to error
2019-09-23 23:07:52 +02:00
Ivan Medina
f339d2d034 [parser] Disallow numeric separator in unicode scape sequences (#10468)
* [parser] Disallow numeric separator in unicode scape sequences (#10460)

* raise error only when numeric separator plugin is set

* Adds argument for checking numeric separator

* Fix condition for readability

* Add test for hex escape sequence and rephrase error message

* Remove exposure for allowNumSeparator in readHexChar method
2019-09-23 22:47:18 +02:00
Nicolò Ribaudo
3069747a81
Leave trailing comments after handling a possible trailing com… (#10445)
* Leave trailing comments aftre handling a possible trailing comma

* perf
2019-09-23 19:14:43 +02:00
Tomer Aberbach
962015f7e7 docs: updates docs of findParent and find (#10479) [skip ci]
Makes the documentation of `findParent` and `find` consistent and documents their `null` cases.
2019-09-22 23:00:13 +02:00
Vivek Nayyar
b7333ea97a added check to disallow super.private variable access and test case added (#10472)
* 🚀 added check to disallow super.private variable access and test case added

* ♻️ change the other linting change back to how it was

* ♻️ change the other linting change back to how it was

* ♻️ added newline at the end test output.json file

* ♻️ changed the linting style to the way it was

* ♻️ updated error message, removed super private member access test cases from whitelist of flow and test 262 suite

* ♻️ added newline in output.json
2019-09-21 00:22:37 +02:00
Nicolò Ribaudo
46c70ad734 Update PULL_REQUEST_TEMPLATE.md (#10473) [skip ci] 2019-09-20 11:27:49 -04:00
Nicolò Ribaudo
3a7b6e1c22
Force update of test262-stream
v1.2.0 doesn't support Test262 v4
2019-09-20 12:54:28 +02:00
Guy Waldman
9c1ad0a9f7 [parser] Disallow static fields named constructor (#10461)
* Disallow static fields named `constructor` in a class

    - Disallowed static fields named `constructor` in a class (previously only non-static were disallowed)
    - Updated the text for the error for one consolidated warning, for both static and non-static fields
    - Added a test
    - Updated an existing test in the `flow` test suite of the parser to reflect the parse error.
  Strangely, the test used to pass and started failing when inlining the `isNonstaticConstructor` method, without any changes.
  In that test, `constructor` was a field, so in theory it should never have passed.
  Would appreciate some feedback on this, as I'm not 100% sure if this is somehow related to Flow

* Update test262 whitelist

* Add comment and fix && operator
2019-09-18 01:19:45 +02:00
Huáng Jùnliàng
87dc201411 refactor: replace regexp-tree by regexpu (#10430) 2019-09-17 17:38:15 -05:00
Nicolò Ribaudo
0ef4972295
Ignore regexp tests from test262 (#10458) 2019-09-18 00:14:27 +02:00
Nicolò Ribaudo
cb881e6b3f
[parser] Report escapes in kws only if they won't be used as i… (#10455)
We can do it by tokenizing escaped keywords as normal identifiers, so that they won't
be accidentally used as real keywords.
2019-09-18 00:13:51 +02:00
Nicolò Ribaudo
45a484f0a2 Enable optional chaining in test262 (#10457) 2019-09-17 12:10:57 -05:00
Nicolò Ribaudo
99f4f6c3b0
Update Test262 (#10448) 2019-09-17 02:14:14 +02:00
Nicolò Ribaudo
e4b4831100
Update GitHub actions to v2 (#10441)
* Update GitHub actions to v2 [skip ci]

* Only run when needed for issues [skip ci]
2019-09-16 22:38:12 +02:00
Huáng Jùnliàng
256fa5aa04 chore: bump regexpu-core to version 4.6.0 (#10439)
* chore: update test fixtures

* chore: test against regexpu-core 4.6.0

* chore: bump regexpu-core dependency
2019-09-13 17:51:24 +02:00
Huáng Jùnliàng
0ee2c42b55 chore: add lint-ts rule (#10427) 2019-09-11 20:24:08 +02:00
Huáng Jùnliàng
1b352ca8a1 chore: remove tryResolve dependency (#10428) 2019-09-11 12:25:18 +02:00
Huáng Jùnliàng
53af9e8b7a fix: allow the process to exit naturally (#10400) 2019-09-11 12:24:44 +02:00
Huáng Jùnliàng
af04f40ee0 fix: pass optionLoc when validating plugin object (#10402) 2019-09-11 12:23:20 +02:00
Bryan Wain
98b14843ba Remove babel polyfill dependency of babel-node (#10429) 2019-09-11 01:57:44 +02:00
Huáng Jùnliàng
4395c22f3a Miscellaneous perf tweak (#10421)
* refactor: early return on hot path

* refactor: read next2 only when next is dot

* perf: mini refactor
2019-09-10 19:47:52 +02:00
Nicolò Ribaudo
610d6bdc62
Do not guess relative execution status for exported fns (#10417) 2019-09-10 19:47:27 +02:00
Tan Li Hau
8027dca501 fix object rest in array pattern (#10275)
* fix object rest in array pattern

* update test fixtures

* early return

* use path.stop() at the right path
2019-09-10 15:18:45 +02:00
Huáng Jùnliàng
81831032c3 chore: remove trim-right dependency (#10420) 2019-09-10 15:17:22 +02:00
FND
daf25af47c Fix typo in changelog (#10409) [skip ci]
s/compliancy/compliancy/g - seems both correct and consistent with more
recent occurrences
2019-09-09 09:22:33 +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
Nicolò Ribaudo
2096d0cfcb
Update @babel deps (#10407)
* Update @babel deps

* Add core-js to transform-named-capturing-groups-regex devDeps

* Don't use fixed deps (they were added by yarn)

* Lockfile
2019-09-08 22:53:20 +02:00