322 Commits

Author SHA1 Message Date
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
James Kyle
10f4546fef Remove unnecessary import 2016-08-08 17:34:01 -07:00
James Kyle
f36d07d303 Fixes from PR comments 2016-08-08 17:32:58 -07:00
James Kyle
9eb12e2c34 Fix lint 2016-08-05 12:40:50 -07:00
James Kyle
fd89bd136f Fix exports of babel-core 2016-08-05 12:36:08 -07:00
Henry Zhu
a8324712a5 v6.13.2 2016-08-05 09:51:34 -04:00
Henry Zhu
7213e57ee2 add tests, be able to pass preset options to test helper 2016-08-05 09:36:52 -04:00
Christophe Hurpeau
425d460ebf [Bug Fix] option manager: val = val.buildPreset should be before the check if the preset supports options 2016-08-05 12:06:07 +02:00
Logan Smyth
f3ad8a8392 v6.13.1 2016-08-04 21:12:12 -07:00
Logan Smyth
66317b10db Fix backward-compatibility of babel-preset-es2015 - fixes T7536 2016-08-04 20:55:20 -07:00
Henry Zhu
6ab3e35075 v6.13.0 2016-08-04 19:34:51 -04:00
Henry Zhu
c6354a2132 es2015: transpile the preset, modify modules option to support "amd,umd,systemjs" as well, tests (#3627)
* es2015: transpile the preset, at spec option

* es2015: add support for modules option

* fixes + tests

* fixup preset error messsage

* es2015: update readme [skip ci]

* pass loose to other module transforms
2016-08-04 17:54:04 -04:00
Logan Smyth
897f553dc7 Support passing options to presets. (#3331) 2016-08-03 22:14:16 -04:00
Henry Zhu
6e58954bce v6.11.4 2016-07-19 21:59:53 -04:00
James Talmage
0a9cbe6e83 git commit add test for package.json config 2016-07-07 16:58:22 -04:00
James Talmage
8e84196eb8 add tests for env options 2016-07-07 16:36:34 -04:00
James Talmage
62ad67e5d9 add tests for build-config-chain 2016-07-03 23:58:44 -04:00
James Talmage
79d8c5aa14 find list of applicable configs without requiring babel-core or plugins
`build-config-chain.js` creates an array of options which will be passed to `OptionsManager#mergeOptions`. The advantage of separating it out is that `build-config-chain` has a very minimal dependency list. The eventual intent is to allow the require hook to lazy load only when required. In other words, if no required files ever match the patterns `ignore` / `only` patterns, the bulk of babel-core, and the associated plugins, will never be loaded.
2016-07-02 03:04:49 -04:00
Logan Smyth
231f27f170 Fix non-unique 'ref' binding name - fixes T7468 2016-06-28 19:16:44 -07:00
Logan Smyth
faf024ad44 v6.10.4 2016-06-21 09:43:33 -07:00
A2ZH
49d36e291d update minimatch v3.0.2 2016-06-21 01:01:42 +08:00
Henry Zhu
77ac82b9f5 v6.9.1 2016-05-29 15:50:04 -04:00
Andrew Johnston
f408f28a02 Fix: assign _this to this when there is no Superclass - Fixes T7364
Closes gh-3508
2016-05-28 09:51:28 -04:00
Jesse McCarthy
ff044bbb0f Use more ideal mocha hooks (#3446)
* setup() instead of manual before().
* suiteTeardown() instead of afterEach().
2016-05-19 08:26:59 -04:00
Henry Zhu
cf6304a34b v6.9.0 2016-05-17 14:49:17 -04:00
Jordan Klassen
dc1f40540d Upgrade to lodash 4 (#3315)
* Upgrade to lodash 4

* Fix incorrect require in babel-runtime/scripts

* Replace cloneDeep with cloneDeepWith where applicable
2016-05-13 17:15:14 -04:00