997 Commits

Author SHA1 Message Date
Henry Zhu
a73115f401 update core [skip ci] 2016-12-16 16:49:58 -05:00
Henry Zhu
608e77e389 v6.20.0 2016-12-08 18:25:39 -05:00
Henry Zhu
16a05166b2 v6.20.0 changelog [skip ci] (#4971)
* v6.20.0 changelog [skip ci]
* remove old license since rewrite [skip ci]
2016-12-08 18:17:33 -05:00
Sven SAULEAU
455d888ce8 update package documentation (#4948) [skip ci] 2016-12-06 14:24:52 -05:00
Sven SAULEAU
351c1d3b4f Update README [skip ci] (#4938) 2016-12-05 13:36:31 -05:00
Henry Zhu
e86f62b304 README: add --save-dev [skip ci]
Closes gh-4910
2016-11-29 08:40:27 -05:00
Sven SAULEAU
2311b5b53a README: remove dollar in sh snippets [skip ci] 2016-11-29 08:39:23 -05:00
Daniel Tschinder
1d9e509df2 Fix eslint (#4897)
* Fix eslint call

* Fix linting errors
2016-11-26 11:24:38 -05:00
Henry Zhu
cd041541b8 Fix bug + Generate test fixtures if no expected.js (#4858) 2016-11-17 17:53:46 -05:00
Henry Zhu
7b64a9d914 v6.18.2 2016-11-01 17:30:53 -04:00
Henry Zhu
1a974e58d0 v6.18.1 2016-11-01 17:17:16 -04:00
Diogo Franco
35b795ce54 Fix Valid example to be actually valid (#4773)
* Fix Valid example to be actually valid

* Rename 'pluginName' to 'presetName' in the example
2016-10-25 11:27:20 +02:00
Henry Zhu
12f9cd0826 v6.18.0 2016-10-24 17:18:36 -04:00
Moti Zilberman
6bc10b5573 Support ObjectExpression in static path evaluation (#4746) 2016-10-17 18:55:02 -04:00
Simen Bekkhus
9c2794dc85 Replace path-exists with fs.existsSync (#4731)
It's not deprecated anymore, see nodejs/node#8364
2016-10-17 14:31:49 -04:00
Richard Macklin
6ec93d782b Extract resolveFromPossibleNames to remove duplicated logic
"DRY"s the duplicated algorithm in resolvePlugin and resolvePreset
2016-10-16 11:18:43 -07:00
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
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
76de1cc8a4 Update tests for changed error messages in Babylon (#4727)
Depends on babel/babylon#172.
2016-10-14 16:25:56 -04:00
Moti Zilberman
2827d660fc Make special case for class property initializers in shadow-functions (#4502) 2016-10-14 15:21:11 -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
Daniel Tschinder
1dca51f8ab Enable babel for tests (#4564)
* Enable babel for tests

This enables babel for tests by using a mocha compiler
It uses the babel config from package.json
Transformed OptionsManager test to es2015 to see if it works
Removed the 5s timeout from cli tests, as the default timeout is already 10s, this should probably fix the timouts on travis that we had in babylon
Also run the cli tests on travis, they were disabled if istanbul active, but istanbul is always active on travis so we were never running this tests.

* ignore scripts directory

* only register for tests

* Set only flag correctly
2016-10-12 10:56:50 +02:00
Eric Rozell
c2387f0444 fix(shouldIgnore): filename normalization should be platform sensitive (#4631)
* fix(shouldIgnore): filename normalization should be platform sensitive

shouldIgnore normalizes the path of the filename prior to running any "only" regexes or functions. The normalization uses "slash", which has some undesirable special cases for non-ASCII characters and longer paths. Changing the normalization behavior to always replace path separators.

There is no real need to add additional tests, because the tests are not run in an environment where path.sep !== '/'.

* Minor style fix to use double quotes.

* Remove conditional for regex replace to keep consistent behavior.

* whitespace [skip ci]
2016-10-11 16:02:50 -04:00
Kai Cataldo
27ee74ea14 Better error messaging when preset options are given without a corresponding preset (#4685) 2016-10-11 16:56:53 +02:00
Brian Ng
0aa3ac2bb5 Update babel parser options (#4688)
* Update babel parser options
2016-10-07 14:30:47 -04:00
Sebastiaan Deckers
7977c9249e Babel API example (#4675) [skip ci]
Just a minor fix. I'm new to Babel's API and this tripped me up. Seems like it happened to others before (e.g. #2859). Guessing this came from an earlier `var babel = require('babel-core')` which does work.
2016-10-05 09:50:11 -04:00
Daniel Tschinder
fc54264f70 update json5 to version 0.5.0 (#4649) 2016-10-04 08:32:32 -04:00
Daniel Tschinder
e0dbb1e770 Inline shebang-regex (#4650) 2016-10-03 20:58:26 -04:00
Henry Zhu
e50b3c890f v6.17.0 2016-10-01 15:23:18 -04:00
Daniel Tschinder
5a8070a397 Forward bound shadowed function when hoisting identifiers (#4635)
This change ensures that when hoisting an identifier we do not hoist it up to
the first no shadowed function, but rather up to the bound shadowed function
2016-10-01 13:24:12 -04:00
Daniel Tschinder
46339463bd Resolve presets with named exports correctly (#4620) 2016-09-30 18:27:40 -04:00
Henry Zhu
6d22f258db v6.16.0 2016-09-28 15:38:45 -04:00
Henry Zhu
5ea57d5e9c fix tests and add exec test 2016-09-27 17:37:21 -04:00
Henry Zhu
b2eb5eca6f babel-core: add options for different parser/generator (#3561)
* babel-core: add options for different parser/generator

* test for experiemental plugins, other babylon options

* fix passing options into parser

* Fix when no code is provided

* fixup tests

* fix tests again

* use filename and fallback to cwd
2016-09-27 09:09:31 -04:00
Moti Zilberman
03d772c2ec Computed class properties (#4500)
* Support computed class property names (#4499)

** Depends on babel/babylon#121 **

* `babel-types`: Add `computed` field to `ClassProperty`

* `babel-plugin-transform-class-properties`: handle computed property names correctly

* `babel-generator`: add tests for class properties (computed/literal, static/instance)

* doc: Update babel-types with ClassProperty.computed

* chore(package): update babylon to v6.11.0

* babel-types: move ClassProperty.computed to be last builder arg
2016-09-26 17:46:00 +02:00
Micha Reiser
a81a0d0f84 Fix fileName options passed to babylon (#4570)
The filename options used by babylon is called `sourceFilename` and not `filename`. Therefore the option should be adjusted to be called `sourceFilename`.
2016-09-26 16:31:05 +02:00
Justin Ridgewell
c2ed9de7fb Flip default parameter template (#4515)
* Flip default parameter template

YMMV, I saved ~10b on a 2kb library. Not noticeable at the small scale, by why not do it anyway?

I've (unscientifically) found that flipping the default parameter conditional yields better gzip results. I think this is due to the slightly longer string it can now repeatedly match:

```js
// old
var param = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0]
--------------------------------------------------------------^

// new
var param = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null
------------------------------------------------------------------------^
```

Though it's entirely likely gzip will also choose up to the index of the arguments if you many default parameters at different indexes.

* Update tests
2016-09-25 14:05:53 -07:00
Kay J
4dcc981d6a Removed unnecessary 'return' statements. (#3653)
* Removed unnecessary 'return' statements.

Returning a 'Promise' value in 'promise.then()' makes promise chains.
Used memory and promises are not garbage collected
until finishing 'helpers.asyncToGenerator'.

* Update test
2016-09-25 13:57:59 -07:00
Logan Smyth
ef794198e9 Allow presets to be ES6 exports. 2016-09-25 11:41:43 -07:00
Henry Zhu
c07919bc9b Add support for preset organization shortcuts (#4542)
* add support for @org shortcats, fixes #4362

* add shortcut test

* fixes
2016-09-21 16:44:13 -04:00
Moti Zilberman
e64d86c1eb If loading a preset fails, show its name/path (#4506) (#4517) 2016-09-17 23:01:08 -04:00
Henry Zhu
5ce325c399 v6.14.0 2016-08-24 17:40:46 -06:00
Daniel Tschinder
10cd6519d8 Fix class inheritance in IE <=10 (T3041) (#3527)
* Fix class inheritance in IE9 & IE10 (T3041)

Internet Explorer 9&10 do not support __proto__ at all, don't have
Object.setPrototypeOf(), but have Object.getPrototypeOf().

Because of this setting the prototype is not possible, which makes the
babelHelpers.inherits() function to set __proto__ although not supported.

Afterwards Object.getPrototypeOf() is used, but this one is not
respecting the "custom" property __proto__ that we set.

The solution is to check for __proto__ first and afterwards fallback to
Object.getPrototypeOf().

* Do the same logic in babel-helper-replace-supers

* Fix tests

* Extract creation of prototype nodes to small helper
2016-08-23 15:08:44 -04:00
Sebastian McKenzie
07b3dc18a0 Add wrapPluginVisitorMethod option to allow introspection and metrics tracking of plugins (#3659) 2016-08-20 10:36:52 -04:00
Sebastian McKenzie
4a19661346 Generate names field for identifiers to get correct names mappings (#3658) 2016-08-16 13:43:55 -04:00
Henry Zhu
090f8cd10f Internal: remove comments (#3657) 2016-08-15 11:40:10 -04:00
Jordan Scales
ca27cf135d Revert "Merge pull request #3641 from babel/guy-fieri" (#3646)
This reverts commit 033681af8941d9678961f985c13e500c3c70f337, reversing
changes made to a2d66c0fc8ee58e82be3efd59173803e66dee3e0.

I brought you into this world, and I can take you out.
2016-08-15 11:35:39 -04:00