28 Commits

Author SHA1 Message Date
Buu Nguyen
c474fd48e1 Fix issue semi-colon gets inserted unnecessarily (#5749)
* Fix issue semi-colon gets inserted unnecessarily

* Simplify if condition a bit
2017-05-19 16:54:51 -04:00
Brian Ng
cd9bb7ba10 Ensure default exported classes keep entry in export table (#5488) 2017-04-09 16:39:15 -07:00
Arshabh Kumar Agarwal
a55f38b127 Changes the throw error for test in super-illegal-non-constructor-call (#5450) 2017-03-22 00:24:28 -04:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00
Dan Harper
7f772e94ce retain method return types on transform-es2015-classes (closes #4665) (#4668) 2016-10-04 18:22:29 -04:00
Henry Zhu
174e44f656 fix broken test from old PR 2016-08-31 14:55:38 -04:00
Stanislav Sysoev
33da726638 Not null check in babel-helper-builder-binary-assignment-operator-visitor (#3647)
Fix: T7537 — https://phabricator.babeljs.io/T7537

When transforming super call in class constructor, part of ast is replaced using method "replaceWithMultiple" here:
https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-es2015-classes/src/vanilla.js#L379

It leads to removing the node (replacing it with null) here:
https://github.com/babel/babel/blob/master/packages/babel-traverse/src/path/replacement.js#L51

But parent ExpressionsStatement is still untouched and when it reaches visitor generated in here
https://github.com/babel/babel/blob/master/packages/babel-helper-builder-binary-assignment-operator-visitor/src/index.js#L18

It blows up because expression is null from previous visitors.
2016-08-31 14:41:49 -04: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
Henry Zhu
937b8a6767 use flow instead of flow-comments 2016-03-04 15:50:05 -05:00
Henry Zhu
ad81f5b149 check if valid.id is defined 2016-01-22 14:20:54 -05:00
Amjad Masad
95c93dd22b Method names should not be bound to body
As an artificat of compiling methods to named function expressions the
function name is being considered a "local" binding in the function
body. This means that we will throw errors anytime someone would want to
create a new local binding with the same name.

This is solved by assigning a symbol to function Identifiers that
indicates that they should not be considered local bindings.
2016-01-17 13:19:37 -08: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
James Kyle
abb85b498a Merge pull request #3138 from loganfsmyth/class-rename-failure-T2494
Skip name inference on hard-to-replace classes - fixes T2494
2015-12-05 20:58:37 -08:00
Logan Smyth
925804798d Skip name inference on hard-to-replace classes - fixes T2494 2015-12-05 17:07:10 -08:00
Logan Smyth
9f32061769 Merge pull request #3134 from loganfsmyth/default-renamer-T6750
Ensure that default exports have a name before splitting them - fixes T6750
2015-12-05 16:23:39 -08:00
Logan Smyth
a12a116b9f Ensure that default exports have a name before splitting them - fixes T6750 2015-12-05 15:28:48 -08:00
Logan Smyth
03f189fc46 Ensure that the async/generator flags carry over when converting class methods - fixes T6755 2015-12-05 12:24:00 -08:00
phantom10111
9a270a3d0a Fix return super(); in class constructor - fixes T2997 2015-11-25 23:53:53 +01:00
Logan Smyth
b3f2ea0aa1 Avoid duplicating traversal of class declarations - fixes T2694 2015-11-19 00:30:56 -08:00
Sebastian McKenzie
01356191d4 avoid revisiting classes - #2694 2015-11-13 16:55:54 -08:00
Sebastian McKenzie
688dcec6a3 fix queueing of nested paths being pushed onto the priority queue 2015-11-13 03:37:15 -08:00
Sebastian McKenzie
f91cfa68b9 ignore callee supers when doing spread compilation - fixes #2775 2015-11-12 01:59:07 -08:00
Sebastian McKenzie
e09d442be6 remove redundant test 2015-11-11 02:02:39 -08:00
Sebastian McKenzie
f601e62678 add regression test - fixes #2941 2015-11-10 16:02:45 -08:00
Sebastian McKenzie
54c13eef5c fix exported classes with static class properties - fixes #2868 2015-11-10 15:56:22 -08:00
Sebastian McKenzie
29f756fd6f add regression tests - closes #2663 2015-11-10 14:40:30 -08: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