22 Commits

Author SHA1 Message Date
Logan Smyth
95e08b6d2a Convert UMD to use new implementation of module logic. 2017-09-12 17:17:41 -07:00
Daniel Tschinder
5565e1b406 Correctly requeue CallExpression in AMD transform (#5497)
* Correctly requeue the define()-CallExpression

* Use pushContainer
2017-09-09 20:33:35 -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
Henry Zhu
0f823beeb1 Newlines in fixtures (#6044)
* write newlines for fixtures

* rerun fixtures
2017-08-02 15:35:29 -04:00
Justin Ridgewell
827c70e015 Support exporting deep destructuring (#5953) 2017-07-18 14:07:09 -05:00
Daniel Tschinder
b3372a572d Remove whitespace generation (#5833)
* Remove whitespace generation and rely on default printing

Changes to printing:
* Add newline after last empty SwitchCase
* Add newlines around block comments if they are non-flow comments or contain newlines

* Fix a few more fixtures
2017-06-27 21:57:02 -05:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00
Brian Ng
01bc43464e Ensure directives get printed in block statements (#4873) 2016-12-16 15:30:14 -05: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
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
Kai Cataldo
aa51dd4a3d Throw error for multiple exports default (#3518)
Fixes https://phabricator.babeljs.io/T7242
2016-08-16 13:21:00 -04:00
Richard Macklin
6c9f241812 Add test case for overriding exported global name without specifying the moduleId or moduleIds options 2016-07-26 22:38:40 -07:00
Richard Macklin
ac9487abf3 Add the ability to override the exported global using the globals map
when `exactGlobals` is true
2016-07-26 22:38:39 -07:00
Richard Macklin
c252d3dae6 Add exactGlobals option to transform-es2015-modules-umd plugin
to enable more flexibility specifying global names
2016-07-26 22:38:39 -07:00
Henry Zhu
253918c30f Fix buildExportAll to account for commonjs/amd/systemjs (#3591)
* Fix buildExportAll to account for commonjs/amd

If the re-exported module was generated with Babel and it is a commonjs or amd module and so is the current module, this will result in an attempt to redefine the __esModule property, which throws a runtime error.

* Add test: don't overwrite __esModule on re-export

(Failing.)

* fixup tests

* Add fix for systemjs
2016-07-23 13:21:07 -04:00
Ben Newman
9acd33b93a Make buildExportAll generate pure ES5 code.
The untransformed `let` keyword causes problems for older parsers. I
understand using `let` instead of `var` ensures each getter function has
its own binding for the KEY variable, but the same can be accomplished
(with less code) using a `.forEach` callback function, and this way
there's no need to worry about generating a unique name for the `key`
variable.
2016-03-02 00:08:55 -05:00
Clay Reimann
92946ccac3 [UMD] Fixed T6832 2016-02-29 08:23:35 -06:00
guybedford
5a0d5dc500 babel-template clearNode fix to not remove existing sourceMaps (T6903) 2016-02-04 01:31:18 +02:00
Casey Foster
c7c4d7f5fd Fix T2929, T6796, stop leaking directives 2016-01-08 15:29:42 -06:00
Amjad Masad
0d8e5a9e86 Fix over-parenthesizing of function expressions 2015-12-24 14:55:51 -08:00
Sebastian McKenzie
1fa24b1efd rename babel-plugin-external-helpers-2 to babel-plugin-external-helpers 2015-12-24 03:54:40 +00:00
Sebastian McKenzie
15969a0904 move all plugin tests out of babel-core and into their appropriate folders 2015-11-08 23:04:10 -08:00