2757 Commits

Author SHA1 Message Date
Justin Ridgewell
4b297907d1 Move fix into #checkBlockScopedCollisions 2017-08-25 19:23:11 -04:00
Moti Zilberman
48c114169f Move up check for binding kind "local"
This puts the check before the call to `checkBlockScopedCollisions`.
Fixes #4946.
2017-08-25 19:21:38 -04:00
Moti Zilberman
68786c4f0f Add test for issue #4946 2017-08-25 19:21:38 -04:00
Moti Zilberman
1ef5871300 Add tests for #5491 and related cases
The two function expression tests would fail before 6705de7. The
function declaration test was not a failing case but is added here for
completeness.
2017-08-25 19:21:38 -04:00
Moti Zilberman
c3e8715010 Mask existing "local" bindings when registering new binding
Fixes #5491.
2017-08-25 19:21:38 -04:00
Mauro Bringolf
d8b4073536 Consistent const violations (#6100)
* Changed updateExpression to report itself as violation instead of its argument

* Update getBindingIdentifiers to work with forXStatement and return proper node as violation

* Updated unaryExpression violation to be consistent with changes.
2017-08-24 21:19:02 -04:00
Mateusz Burzyński
3c4f19a28d Adjusted Object Rest/Spread tests to use only allowed syntax from the latest spec (#6102) 2017-08-24 15:50:43 -04:00
Noah Lemen
2db0c3ad1d linting: disallow t.identifier("undefined") in plugins (#6096)
* add new custom eslint rule, replace remaining t.identifier("undefined") with buildUndefinedNode(), update tests

* change no-undefined-identifier reporting descriptor
2017-08-24 15:43:01 -04:00
Nicolò Ribaudo
4577bd1b7c TypeParameterInstantiation params can be "Flow" nodes, not "FlowType" (#6140) 2017-08-22 23:11:02 -04:00
Daniel Lo Nigro
93cf26abca Fix babel-standalone for realz (#6137)
* Fix babel-standalone

* Fix infinite loop in Makefile (oops)

* Override Node.js module resolution to handle babel-core
2017-08-22 13:46:30 -07:00
Astha Sharma
62c22c7b5d Removed the deprecated jsx pragma detection code (#6145)
* Removed the deprecated jsx pragma detection code and the concerned tests that included jsx-pragma

* Removed extra tests

* Restored packages/babel-plugin-transform-react-jsx/test/fixtures/react/honor-custom-jsx-pragma-option/
2017-08-22 15:29:06 -04:00
Bryan Wain
63baaa7148 add --config-file option to CLI to pass in .babelrc location (#6133) 2017-08-22 13:58:24 -04:00
Justin Ridgewell
7e726a81e6 Complete export transform split (#6139)
They were each transforming the other's syntax (including namespace
transform would transform default, too, and vice-versa).
2017-08-21 14:15:40 -04:00
Ramiro Silveyra d'Avila
9e4e64dac9 Remove Flow support in React preset (#6118) 2017-08-21 10:48:18 -04:00
Sangboak Lee
c6a094a9d2 Split export extensions into 2 different plugins, update stage presets (#6080) 2017-08-19 09:35:40 -04:00
Anup
6ab3b4c0e3 Add 'configurable' property to class fields (#6123) 2017-08-16 10:12:38 -04:00
Henry Zhu
70ab2e0620 Merge pull request #6113 from Andarist/fix/regenerator-fixtures
Fix/regenerator fixtures
2017-08-16 10:11:24 -04:00
Sven SAULEAU
0d16499fc0 Merge pull request #6124 from uxter/patch-1
Update README.md
2017-08-16 15:30:51 +02:00
Sven SAULEAU
77bbe20352 fix: [skip ci] split babel config 2017-08-16 15:30:16 +02:00
Vasiliy Shilov
bd569433c4 Update README.md: A semicolon is required after a class property. 2017-08-16 16:18:39 +03:00
Mateusz Burzyński
fffa604023 Fixed regenerator related fixtures 2017-08-16 10:02:33 +02:00
Ben Newman
e08ff8e650 Update regenerator-runtime to version 0.11.0. 2017-08-16 10:02:33 +02:00
Ben Newman
b660f61b92 Update regenerator-transform to version 0.10.0. 2017-08-16 10:02:33 +02:00
Brian Ng
2eaff3d01c Fix rest-member-expression-optimisation fixture (#6116) 2017-08-15 21:34:09 -04:00
Piotr Kowalski
b684699f79
Typo in name of most famous language [skip ci] 2017-08-15 19:35:41 -05:00
Justin Ridgewell
4ca686b7be Fix relative execution location introspection (#5741)
So, I was reading the new Flow type strictness and noticed
https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/
Specifically, I wondered whether the `sum_all` example would copy the
arguments into an array, then loop over. Sadly, it does.

```js
function sum_all(...rest) {
  let ret = 0;
  for (let i = 0; i < rest.length; i++) { ret += rest[i]; }
  return ret;
}

// output
function sum_all() {
  var ret = 0;
  for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) {
    rest[_key] = arguments[_key];
  }
  for (var i = 0; i < rest.length; i++) { ret += rest[i]; }
  return ret;
}
```

But then I noticed if I changed `let i = 0` to `let i: number = 0`, it
worked directly on `arguments`. That lead me down a rabbit hole to
`Path#_guessExecutionStatusRelativeTo`. When tracing through, the last
comparison made no sense to me. It was trying to find the index of
`"init"` in a list of `["declarations"]` and `"body"` in `["directives",
"body"]`. Red flags and such.

But it makes sense when you're trying to compare the visitor order of
the common ancestor path. Then we're trying to find `"init"` in a list
of `["init", "test", "update", "body"]`. Oh, and there's `"body"` in
there too! And now we know the `ForStatement`'s `init` is executed
before the `body`.
2017-08-14 22:22:18 -04:00
Nicolò Ribaudo
b84f8e9234 Don't use _possibleConstructorReturn inside arrow functions (#6103)
Arrow functions can't be entrly skipped while traversing because this
references inside of them needs to be transformed, so I added a check
which prevents return statements inside arrow functions from being
saved for the transformation.

Fixes #5817 (regression)
2017-08-14 11:11:05 -04:00
Brian Ng
9e51038ad9 Fix class prop test fixture (#6090) 2017-08-14 09:20:36 -05:00
Daniel Lo Nigro
a04c18af71 Move babel-standalone into main Babel repo (#6029)
* Move babel-standalone into main Babel repo

* Don't try to gather coverage data for babel-standalone test

* Fix JSX test

* Always use npm v4 on Travis

* Include pull request number as part of version number

* Cherry-picking 5721b2e43e

Remove deprecated packages to prevent Babel v6 files from being pulled in

* Use RootMostResolvePlugin to dedupe packages

* Avoid destructuring so the build works on archaic Node.js versions

* - Fix version number
- Remove Babili packages (they should be in separate babili-standalone)
- Remove deprecated  syntax-class-constructor-call

* - Remove more Babili packages
- Remove `babel-plugin-inline-replace-variables` for now as it pulls in Babel 6 stuff

* Actually remove reference to babel-plugin-undeclared-variables-check

* Add Babylon to root package.json so we hoist the right version. This fixes the tests.
2017-08-11 23:36:19 -07:00
Diogo Franco
0538c3cd8c Add another test for runtime order of template literals (#6092)
More proof that it really is unsafe to merge the .concat calls if the
value is an expression that has any chance of executing impure code 😢
2017-08-12 14:11:27 +09:00
Diogo Franco (Kovensky)
cd66657f34 Update outdated test fixture 2017-08-12 14:10:19 +09:00
Andy
9243c78ea2 babel-plugin-transform-class-properties: Ignore type annotations when looking for name collisions (#6082) 2017-08-11 10:27:48 -05:00
Sangboak Lee
218f191a59 remove left transform-class-properties from stage (#6088) 2017-08-10 22:30:45 -04:00
Noah Lemen
4fdd75695b Update Class Fields to Stage 3 and change default behavior (#6076)
* add transform-class-properties to stage 3, set spec mode to default

* update readme with examples; use `buildUndefinedNode()`; change behavior to always define both static and nonstatic class properties regardless of spec/loose mode; update tests
2017-08-10 11:19:49 -04:00
Rick Waldron
9c91e35ce4 Add numeric separator to stage 2 preset (#6071) 2017-08-10 11:05:35 -04:00
Brian Ng
370559c62f Replace decache with direct removal in babel-register tests (#6085) 2017-08-10 10:52:27 -04:00
Andy
a74b307752 babel-types: Add missing field, fix incorrect definitions (#6083)
* babel-types: Add missing field, fix incorrect definitions

* Regenerate babel-types readme
2017-08-09 16:56:19 -04:00
Mateusz Burzyński
b41fe4efb1 [docs] Added clarification note about transform-react-inline-elements usage … (#6078)
* Added clarification note about transform-react-inline-elements usage with transform-runtime [skip ci]

* small tweaks [skip ci]
2017-08-09 08:45:02 -05:00
Andy
68d2f8d161 Add "classProperties" plugin to babel-generator typescript tests (#6074) 2017-08-08 17:38:39 -04:00
Andy
1c1ce5a9e4 Move parser plugin from babel-preset-typescript to babel-plugin-syntax-typescript (#6070) 2017-08-08 16:01:14 -05:00
Boopathi Rajaa
ab76cb6b53 Fix scope of catch block (#5980)
* Fix scope of catch block

* Throw error on Duplicate variable declaration

* Update test
2017-08-08 16:26:29 -04:00
Henry Zhu
79f4956948 v7.0.0-alpha.19 2017-08-07 18:21:08 -04:00
Henry Zhu
7f92e1d9dd Update gulp, fix build (#6061)
* gulp-babel 7.0
2017-08-07 17:09:22 -04:00
Andy
e37a5eb5eb Add babel-plugin-syntax-typescript, babel-plugin-transform-typescript, and babel-preset-typescript (#5899)
* Add babel-plugin-syntax-typescript and babel-plugin-transform-typescript

* Add babel-preset-typescript

* Remove unnecessary handler for JSXOpeningElement

* Use `t.isFoo(node)` instead of `node.type === "Foo"`

* Clean up parameter property assignment generation

* Don't use function for `isSuperCall`

* slice -> shift

* Calculate sourceFileHasJsx only if necessary

* Remove `export =` support

* remove some syntax readme newlines [skip ci]
2017-08-07 11:45:52 -04:00
Henry Zhu
66ec5263a4 Use Yarn Workspaces (#6056)
* update lerna and lerna-changelog

* Lerna: enable yarn, yarn workspaces [skip ci]

* use older version of Babel since it matches on semver (cannot be the same version)

* install yarn version

* revert node engine change

* update flow

* circle ci on 8

* update lock
2017-08-05 14:48:15 -04:00
Teddy Katz
13d931c417 Don't insert the same node into the AST multiple times (fixes babel/babili#556) (#6054) 2017-08-04 19:00:29 -04:00
Henry Zhu
47a9ba3440 Merge pull request #6051 from babel/5709-2
Rewrite parameter transform and drop _blockHoist reliance
2017-08-04 18:55:23 -04:00
Henry Zhu
a1debae8f0 babylon beta.19 (#6053) 2017-08-04 14:46:12 -04:00
Henry Zhu
0e58007264 add test for spread with hole 2017-08-04 12:06:26 -04:00
Henry Zhu
577173cc02 fix export when array destructuring exported value with hole 2017-08-04 11:53:49 -04:00