7924 Commits

Author SHA1 Message Date
Henry Zhu
37419b44b9 v6.16.3 2016-09-29 11:46:53 -04:00
Joakim
aa0aada8ad Forcing source-map-support module into node environment, so its not tricked by jsdom (#4607) 2016-09-29 17:01:31 +02:00
Henry Zhu
6abc28e532 update types readme [skip ci] 2016-09-29 08:47:24 -04:00
Henry Zhu
b3e04da882 v6.16.2 2016-09-29 08:46:45 -04:00
Daniel Tschinder
5a1984aa41 make babel-helper-remap-async-to-generator bc with babel 6.15 and lower (#4603) 2016-09-29 08:14:39 -04:00
Dan Harper
682e9658c9 Fix bodyless async functions (#4600)
* fix bodyless async functions (#4599)

* Do the same in the async-generator-functions transform
2016-09-29 12:01:37 +02:00
Henry Zhu
6d82ee297e fix link [skip ci] 2016-09-28 18:29:03 -04:00
Henry Zhu
08c0557b26 v6.16.1 2016-09-28 17:25:12 -04:00
Henry Zhu
64cdbf7ca0 Add back babel-runtime (#4591) 2016-09-28 17:21:36 -04:00
Henry Zhu
6d22f258db v6.16.0 2016-09-28 15:38:45 -04:00
Henry Zhu
4f2637e1ec v6.16.0 changelog [skip ci] (#4545)
* v6.16.0 changelog [skip ci]

* Small fixes

* Typo 🙈
2016-09-28 13:49:02 -04:00
Dan Harper
8709899b42 fix flow-strip-types/flow-comments removing entire ClassProperty (#4587) 2016-09-28 18:25:33 +02:00
Henry Zhu
5ea57d5e9c fix tests and add exec test 2016-09-27 17:37:21 -04:00
zenparsing
26e79c5433 Implement support for async generator functions and for-await statements 2016-09-27 17:37:21 -04:00
Simon Lydell
bf0e256c3a babel-code-frame: Highlight strings with green (not red) (#4579)
- Red makes it look like something is wrong with the string.
- On Ubuntu-based systems, it looks kinda broken.
- The error markers (`>` and `^`) as well as invalid tokens are already
  marked with red. By not having strings red, the most important
  information -- the error location -- is more visible.

This is a continuation of commit fa1de5ce (PR #4572).
2016-09-27 15:35:17 -04:00
Simon Lydell
e40aad53a4 Improve syntax highlighting colors (#4572)
- Highlight the error location markers in bold red.
- Dim the line number gutter with grey.
- Don't highlight brackets. Few editor color schemes do.
- Add JSX tag highlighting.
- Don't highlight punctuators with bold. That looks bad on Ubuntu based
  systems. Instead, highlight them the same way as JSX tags, which
  results in really nice JSX highlighting.
- Highlight capitalized variable names.
- Make invalid tokens stand out with a red background.
2016-09-27 11:10:51 -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
Maxime Thirouin
90f3f9049f babel-register: update source-map-support to latest (#4577)
This allows in some case when you use other modules that use this source-map-support lib to get only a single version at the root of node_modules. For example, this can prevent issues when requiring using webpack Banner plugin (compiled code is not always requiring dependencies as you would expect).
2016-09-27 14:55:35 +02:00
Daniel Tschinder
50d2c5e930 Update CONTRIBUTING.md 2016-09-27 10:46:03 +02:00
Henry Zhu
afbe3997a8 babel-code-frame: add options for linesBefore, linesAfter (#4561)
* babel-code-frame: add options for linesBefore, linesAfter

* add example, use list of keywords

* a [skip ci]

* Update index.js
2016-09-26 16:12:35 -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
Henry Zhu
fc2b3cb465 Fixes T2299: Prevent REPL from printing implicit 'use strict' (#4562)
* Fixes T2299: Prevent REPL from printing implicit 'use strict'

* Test for T2299

* make fixes
2016-09-25 23:29:37 -04:00
Daniel Tschinder
702259d483 Only exit if the TRAVIS_COMMIT_RANGE is not empty (#4565) 2016-09-25 23:29:13 -04:00
Logan Smyth
819cde936c Merge pull request #4511 from motiz88/fix-4462
Fix UpdateExpression handling in es2015-modules-commonjs, resolve #4462
2016-09-25 14:16:53 -07: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
Logan Smyth
08b45ca853 Merge pull request #4534 from BoomTownROI/master
Fix issue with minified libraries and code coverage
2016-09-25 13:59:43 -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
66a4aec1f9 Merge pull request #4566 from loganfsmyth/fix-3695
Allow presets to be ES6 default exports.
2016-09-25 12:52:42 -07:00
Justin Johansson
bae59470da Upgraded all babel-preset-xxxs but babel-preset-es2015 to export syntax 2016-09-25 12:27:32 -07:00
Logan Smyth
ef794198e9 Allow presets to be ES6 exports. 2016-09-25 11:41:43 -07:00
Justin Johansson
e16a1657ab Align all babel-preset-xxx packages dir structures with status quo 2016-09-25 11:41:43 -07:00
Daniel Tschinder
c2d2702cf9 Fix destructuring evaluation with call expressions (#4552)
* Fix destructuring evaluation with call expressions

Do not optimize destructions with callExpressions, as the call
might change the value of a variable that we are assigning to.

Fixes #4054

* Also deopt on member expressions

members expressions might be getters who have side effects
2016-09-24 19:08:53 -04:00
Daniel Tschinder
a83262026f Remove unused dependency babel-register (#4560) 2016-09-24 11:46:08 -04:00
Henry Zhu
ca7c48ff28 fix travis docs check (#4556) 2016-09-24 10:11:52 -04:00
Daniel Tschinder
d6f4d85284 Do not include babel-register in every test (#3669)
This is not necessary
2016-09-24 14:51:01 +02:00
Henry Zhu
d7533e899f Internal: cancel build with only .md changes (#4547) 2016-09-22 17:59:47 -04:00
Kai Cataldo
1db8c02d05 Remove duplicate default error (#4543)
* Revert "Throw error for multiple exports default (#3518)"

This reverts commit aa51dd4a3dbb956d8b619d884acf40194d5ffac8.

* Fix export default tests
2016-09-22 12:00:18 -04: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
Kai Cataldo
f3a6e4b0ae Fix tests with duplicate named exports (#4538)
* Fix babel-plugin-transform-flow-strip-types tests

* Fix babel-plugin-transform-es2015-modules-umd tests

* Fix babel-generator tests

* Fix babel-plugin-transform-es2015-modules-systemjs tests

* Fix babel-plugin-transform-es2015-modules-commonjs tests

* Fix babel-plugin-transform-es2015-modules-amd tests
2016-09-21 10:52:59 +02:00
Henry Zhu
a793107bf3 fix lint 2016-09-20 14:04:15 -04:00
Logan Smyth
46eb99b18b Use the real sourcemap API and handle input sourcemaps - fixes T7259 (#3456) 2016-09-20 13:39:01 -04:00
Alberto Piai
8f6d4ae5cf Fix typeof Symbol.prototype (#3686)
* formatting

* fix `typeof Symbol.prototype`

Babel uses a helper function to return the correct value for `typeof
obj` when obj is a Symbol and support for Symbol has been polyfilled.

This function assumes that `obj.constructor === Symbol` implies `typeof
obj === 'symbol'`.

This isn't true when obj is `Symbol.prototype`. In that case (REPL from
node 6, the same holds in Firefox):

```
> Symbol.prototype.constructor === Symbol
true
> typeof Symbol.prototype
'object'
>
```

AFAICS, that's the only case where the assumption doesn't hold.

The test added by this patch fails only on node 0.10, as 0.12 already
has a native implementation of Symbol and the polyfill code doesn't run.

This caused a problem in core-js when it's compiled with babel (the
issue was isolated by @skozin here:
https://github.com/zloirock/core-js/issues/189#issuecomment-209864582).
2016-09-20 12:19:09 -04:00
Basil Hosmer
cb4b2b0744 flow plugin: generate exact object type annotations (#3702) 2016-09-20 11:10:55 +02:00
Dan Harper
fa7321f978 add tests for other module formats, from #4524 (#4532) 2016-09-20 11:04:07 +02:00
Dan Harper
f859830e54 Fix: export default arrows with function naming (#4524) 2016-09-19 21:58:37 -04:00
Rob Landers
c5504c4807 Update context.js
Fix queue size
2016-09-19 15:12:33 -04:00
Moti Zilberman
e64d86c1eb If loading a preset fails, show its name/path (#4506) (#4517) 2016-09-17 23:01:08 -04:00
Daniel Tschinder
cbbc1c7333 fix default exported classes without a name (#4518)
* fix default exported classes without a name

This correctly requeues class without name so the es3 transform can
transform the default keyword.

* Replace phabricator issue number with github
2016-09-17 22:50:54 -04:00
Daniel Tschinder
590ad4d24f Replace phabricator tickets with github ones in code comments (#4519) 2016-09-17 22:50:02 -04:00