10 Commits

Author SHA1 Message Date
Nicolò Ribaudo
10aa97bc10
Allow rest/spread on polyfilled or builtin iterables without Symbol support (#11268)
* Allow rest/spread on polyfilled or builtin iterables when `Symbol` unsupported

Currently, when `Symbol` is not supported, we allow using rest/spread with:
- arrays
- strings
- arguments

With this PR, it will be also possible to use it with
- maps
- sets
- binary arrays

While in old browsers es6 builtins would still need to be polyfilled, it's way
easier to polyfill them because `Symbol` cannot be reliably polyfilled.

I didn't use `instanceof` becase:
- it doesn't work with polyfills not attatched to the global scope
- when using Babel to load polyfills, it would force the inclusion of `Map` and `Set` polyfills even if they are not used

Downside: the current approach of relying on `toString || construcor.name` doesn't work with subclasses.

* Don't use Array.from for array-like objects
2020-03-17 08:14:05 +01:00
Logan Smyth
4da3f3bc64
Update helpers from #7491. (#7532) 2018-03-08 17:06:43 -08:00
Logan Smyth
a75e69ecec Regenerate incorrectly-updated helpers from @babel scope PR. 2017-10-17 10:47:15 -07:00
Henry Zhu
919bdf5e79 Scoped: remove unncessary deps from standalone [skip ci] 2017-10-16 22:49:57 -04:00
Logan Smyth
ed6e6fd7dd Export babel-runtime helpers as standard CommonJS. 2017-09-26 11:28:57 -07:00
Henry Zhu
5c824273bc update to beta.0 [skip ci] 2017-09-19 16:00:18 -04:00
Pranav Prakash
e98bb3dc60 Use new Array instead of Array for V8 optimization (#6250)
* Use new Array instead of Array for V8 optimization

* fix spacing [skip ci]

* Remove extraneous use strict clauses
2017-09-18 14:14:46 -04:00
Logan Smyth
158e9fbfd7 Represent helpers as simple modules. 2017-09-12 22:15:16 -07:00
Logan Smyth
5006c81b77 Apply the new module transform the the babel-runtime helper files. 2017-09-12 17:51:52 -07:00
Henry Zhu
26b9f9ed15 commit one helper to git to check regressions 2017-03-22 18:18:08 -04:00