11 Commits

Author SHA1 Message Date
Nicolò Ribaudo
808d437cf4
Support iterating generators in browsers without Symbol (#13129) 2021-04-15 23:47:53 +02:00
Nicolò Ribaudo
9844eeee84
Put back ESM helpers in a folder where we can use .js (#12919) 2021-03-01 17:31:12 +01:00
Nicolò Ribaudo
0c65ff7a55
Rename index.mjs to _index.mjs in @babel/runtime (#12855) 2021-02-23 02:08:41 +01:00
Nicolò Ribaudo
c10825ab05
Use conditional exports in @babel/runtime for CJS/ESM (#12632) 2021-02-21 17:41:10 +01:00
Huáng Jùnliàng
4e66b8eb6b
Specify runtime exports (#10853) 2020-10-14 20:06:56 +02:00
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
Nicolò Ribaudo
1ba41f2084
Throw better errors for non-iterables when Symbol doesn't exist (#11264) 2020-03-16 16:34:33 +01:00
Carlos Lopez
7b9bc7c28b
fix(rest-spread): Do not require Symbol.iterator for strings (#9794) 2020-03-15 14:54:44 +01:00
Huáng Jùnliàng
4436ffd604 Revert "Add ".js" extension to injected polyfill imports (#10549)" (#10835)
This reverts commit d3a37b5d08074c007268eb15a11ae432165bad5d.
2019-12-07 23:05:35 +01:00
shimataro
d3a37b5d08 Add ".js" extension to injected polyfill imports (#10549)
* Node modules compatibility: add ".js" extension to imported polyfills

* Update fixtures

* add extensions on calling `addDefaultImport()`, not in the function.
2019-12-06 13:30:23 +01:00
Logan Smyth
a8224d40e2 Split @babel/runtime into two separate runtime modules. 2018-08-02 19:25:07 -07:00