7 Commits

Author SHA1 Message Date
Diogo Franco
86a53773f1 Add function name to spec-transformed arrow functions (#5620)
While it may appear that this should be done by es2015-function-name,
another way to think about it is that es2015-function-name implements
the naming that javascript engines are supposed to do; and javascript
engines cannot name function expressions that are the object of a
member expression.
2017-05-03 11:50:37 +09:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05: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
e3af434250 Inserting shadowed 'this' bindings in constructors after super - fixes T7191 2016-03-12 16:18:56 -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
Sebastian McKenzie
15969a0904 move all plugin tests out of babel-core and into their appropriate folders 2015-11-08 23:04:10 -08:00