13320 Commits

Author SHA1 Message Date
Richard Macklin
4ea1007645 Remove unneeded tests
Previously these were testing the logic that is now encapsulated in
getPossiblePresetNames and tested in a unit test
2016-10-16 11:07:16 -07:00
Richard Macklin
e24f07dfda Extract resolvePreset method to babel-core public API
This encapsulates the logic for turning an acceptable preset name into
the absolute path for that preset. It can be used to preprocess a
presets list to map each preset to its absolute path, which is necessary
if `babel.transform` is going to be executed on a file outside the
directory subtree where the presets are installed.

This adds a getPossiblePresetNames helper encapsulating the logic for
what preset names we should try to resolve, and the resolvePreset method
just calls this helper and actually resolves them.
2016-10-16 11:06:47 -07:00
Richard Macklin
f4389a1886 Extract resolvePlugin method to babel-core public API
This encapsulates the logic for turning an acceptable plugin name into
the absolute path for that plugin. It can be used to preprocess a
plugins list to map each plugin to its absolute path, which is necessary
if `babel.transform` is going to be executed on a file outside the
directory subtree where the plugins are installed.

This adds a getPossiblePluginNames helper encapsulating the logic for
what plugin names we should try to resolve, and the resolvePlugin method
just calls this helper and actually resolves them.
2016-10-16 10:52:13 -07:00
Moti Zilberman
9b6e243736 Raise error on duplicate definition of __proto__ (#183)
Spec: http://www.ecma-international.org/ecma-262/6.0/#sec-__proto__-property-names-in-object-initializers

This brings back to life a bit of dead code in Parser.prototype.checkPropClash, and enables several tests that were previously disabled.
2016-10-16 15:16:38 +02:00
Moti Zilberman
7c18bf83cc Increase test coverage (#175)
* Increase test coverage

* Test for error when binding `this` in destructuring pattern

* Ignore coverage of inAsync check in parseAwait - already checked externally

* Ignore coverage of default case in checkPropClash

* Remove unused parameter isAsync from parseParenAndDistinguishExpression

* Ignore coverage of an `else` branch in flowParseTypeParameterDeclaration

* Flow: remove unused parameters to flowParseTypeAnnotatableIdentifier

* Flow: ignore coverage of pass-through throw statement in parseConditional

* Flow: Add test for error on property with type param

* Flow: ignore coverage of pass-through throw statements in parseMaybeAssign, parseArrow

* Add test for error on XML-style comment in module code

* Update test for error on method in object pattern

* Test for error: "Only '=' operator can be used for specifying default value"
2016-10-16 15:04:13 +02:00
Moti Zilberman
490ae9a44c Error on missing expected.json fixture in CI (#188) 2016-10-16 07:55:41 -04:00
Henry Zhu
2dc919d4c6 contributing updates [skip ci] 2016-10-15 19:27:24 -04:00
Henry Zhu
9299921d07 increase git depth [skip ci] 2016-10-15 18:52:14 -04:00
Andrew Levine
9f8ab29213 Change usage of "suite"/"test" in unit-tests to "describe"/"it" (#4734)
Fixes #4733
2016-10-15 18:45:35 -04:00
Andrew Levine
c0038221d7 Run ESLint on test files, and fix lint errors in test files (#4732) 2016-10-15 18:27:48 -04:00
Moti Zilberman
fd218abffb Add .gitattributes forcing LF line endings (#4730) 2016-10-15 10:29:12 -04:00
Henry Zhu
520d69b125 contributing a new plugin [skip ci] 2016-10-15 10:12:23 -04:00
Moti Zilberman
394c9543c9 Add .gitattributes and .editorconfig for LF line endings (#179)
* Add .gitattributes forcing LF line endings

* Add .editorconfig from Babel
2016-10-15 11:08:12 +02:00
Daniel Tschinder
0bbe1e1eec
Readd missin .eslinignore for IDEs 2016-10-15 10:33:05 +02:00
Sam Goldman
26809e8ce7 Property variance type annotations for Flow plugin (#161)
* Property variance type annotations for Flow plugin

Non-method properties and indexers of object types, declare class, and
interfaces can be "positive" or "negative." Class fields, but again not
methods, can also have variance.

This PR generalizes the variance annotations for type parameters into a
new node type, and reuses that node for those properties.

The code for object types is reused for interfaces and declare classes.
The changes there are straightfoward.

The code for class fields is reused for object literals, which do not
support variance annotations (currently). This code is a bit sketchy,
because we always parse variance annotations in the `parsePropertyName`
extension, then error in a the subsequent parse phase for object
literals (`parseObjPropValue`) or class methods (`parseClassMethod`).

* Remove bogus unreachable code, clarify variance parsing conditional

* Don't use a new node type for variance annotations

Adding a new node type, specifically changing the TypeParameter node's
variance property to be node-valued, is a breaking change. We might
choose to make this breaking change in a later version.

* s/start/variancePos
2016-10-14 23:13:27 +02:00
Moti Zilberman
b5877f04b1 Fix up #172 (#177)
* Update two esprima tests to the new "expected TOKEN" messages

* Update dynamic-import to use "expected (" error message
2016-10-14 16:50:07 -04:00
Moti Zilberman
76de1cc8a4 Update tests for changed error messages in Babylon (#4727)
Depends on babel/babylon#172.
2016-10-14 16:25:56 -04:00
Henry Zhu
3525c00397 v6.12.0 changelog [skip ci] (#176) 2016-10-14 16:17:17 -04:00
Henry Zhu
a88a8e9c15 6.12.0 2016-10-14 16:14:54 -04:00
Henry Zhu
6b4a19d520 test fixes 2016-10-14 16:14:38 -04:00
Henry Zhu
9ecf763218 lint [skip ci] 2016-10-14 16:12:05 -04:00
Moti Zilberman
d3af158ba5 Annotate more errors with expected token (#172)
Expanding on #150, this allows `unexpected()` to accept the expected token type instead of a message string.
This overload is then used in a couple more places (that independently implement a logic similar to `expect()`'s) to construct an `Unexpected token, expected FOO` message.
2016-10-14 16:10:09 -04:00
Moti Zilberman
2827d660fc Make special case for class property initializers in shadow-functions (#4502) 2016-10-14 15:21:11 -04:00
Brian Ng
fde16f10fa Add useBuiltIns option to helper-builder-react-jsx (#4655) 2016-10-14 21:18:39 +02:00
Sam Goldman
15183078e6 Add EmptyTypeAnnotation (#4724)
Added to Flow in facebook/flow#c603505583993aa953904005f91c350f4b65d6bd
Parser support added in babel/babylon#171.
2016-10-14 15:16:02 -04:00
Dan Harper
99fbcefa65 allow keyword in Flow object declaration property names with type parameters (#146) 2016-10-14 21:15:00 +02:00
Dan Harper
f7c1af1c1f allow keyword in object/class property names with Flow type parameters (#145) 2016-10-14 21:13:00 +02:00
Jordan Gensler
c63c1bc728 [dynamic-import] Implementing import() syntax (#163) 2016-10-14 14:54:21 -04:00
Kai Cataldo
50baac3251 Remove babel-doctor from babel-cli (#4725)
* Remove babel-doctor from babel-cli

fixes #4678

* Throw when babel-doctor is used
2016-10-14 14:49:16 -04:00
Jamesernator
dc4140dc5f Fixed incorrect compilation of async iterator methods (#4719) 2016-10-14 14:38:57 -04:00
Daniel Tschinder
4c445fd5f8 Remove kcheck (#173) 2016-10-14 12:12:55 -04:00
Daniel Tschinder
b31834ad29 Allow typeAnnotations for yield epressions (#174) 2016-10-14 12:07:46 -04:00
Moti Zilberman
9fc51d6292 Consolidate contiguous var declarations in destructuring transform (#4690)
* Consolidate contiguous var declarations in destructuring transform

Fixes #3081.

* Simplify var node coalescing in es2015-destructuring

* Revert "Simplify var node coalescing in es2015-destructuring"

This reverts commit 15cb373f0726f68225f7080a7ae206a63af174ee.

* More careful condition for var coalescing in es2015-destructuring
2016-10-14 11:51:22 -04:00
Sam Goldman
44f77bd724 Add EmptyTypeAnnotation (#171)
I also noticed that there was missing test coverage for builtin types,
so I added a test for that, which includes the newly added type as well
as the other existing types.
2016-10-13 19:22:13 -04:00
Henry Zhu
71790aace0 update eslint-config, fixes, add commands (#4721)
* update eslint-config, fixes, add commands

* switch plugin
2016-10-13 21:37:07 +02:00
Henry Zhu
5ab09c9617 0.0.6 2016-10-12 22:21:26 -04:00
Henry Zhu
d84ea7f478 ignore scripts 2016-10-12 22:21:23 -04:00
Henry Zhu
3604ff24c3 0.0.5 2016-10-12 22:18:02 -04:00
Henry Zhu
63d4aecf89 android/ios 2016-10-12 22:14:13 -04:00
Henry Zhu
a082a73869 add ie 2016-10-12 22:09:53 -04:00
Henry Zhu
3df730b490 cleanup 2016-10-12 22:08:22 -04:00
Henry Zhu
208e0ed4a4 error when no targets option is passed 2016-10-12 22:07:14 -04:00
Henry Zhu
15f05c0e9e back to upstream, update data for new ff 2016-10-12 21:46:43 -04:00
Henry Zhu
da318cd209 fix browserslist docs [skip ci] 2016-10-12 21:41:27 -04:00
Artem Yavorsky
03f6cae25f Adds browsers property to use browserslist's queries (#19)
* Use browserslist to parse browsers from query.

* Update README.

* Use int values.

* Allow `isPluginRequired` use browserslist queries.

* Fix conflicts during different versions merging.

* Add tests for browserslist queries.

* Early return for getTargets.

* Update README: Describe `browsers` option.

* fix doc [skip ci]

* Move to dependencies [skip ci]

* Remove unused const.

* Use doublequotes for strings.
2016-10-12 21:37:50 -04:00
Henry Zhu
c300230a59 v6.11.6 changelog [skip ci] 2016-10-12 19:39:59 -04:00
Henry Zhu
c6e36eff86 6.11.6 2016-10-12 19:37:16 -04:00
Jeroen Engels
e14f93d1bb Fix crash when exporting with destructuring and sparse array (#170)
* Create reproducible crash when exporting with destructuring and sparse array

* Fix crash when exporting with destructuring and sparse array
2016-10-12 19:36:08 -04:00
Paul Sanchez
4a3893a49e Add Caveat section to Readme.md (#24) [skip ci]
* Add Caveat section to Readme.md

The Caveat section details some known issues and workaround when targeting specific environments and using specific plugins.

* fixes [skip ci]
2016-10-12 13:33:38 -04:00
Henry Zhu
b1fc65530d v6.11.4 changelog [skip ci] 2016-10-12 11:58:11 -04:00