Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Missing ArrayBuffer Built-In #232

Closed
paulroper opened this issue Mar 29, 2017 · 3 comments
Closed

Missing ArrayBuffer Built-In #232

paulroper opened this issue Mar 29, 2017 · 3 comments

Comments

@paulroper
Copy link

Hey! Love the preset. We're working on a project with IE9 support and ran in to a little issue with one of our dependencies (the isEmpty function in Lodash) using ArrayBuffer which IE9 does not support. We're using babel-preset-env to require built-ins and it does not seem to be bringing in ArrayBuffer from corejs.

After taking a look at the source for babel-preset-env, we noticed that the ArrayBuffer built-in is commented out in built-in-features.js and is missing from built-ins.json:

https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js#L32
https://github.com/babel/babel-preset-env/blob/master/data/built-ins.json

Is there a reason why this line has been commented out?

We've worked around the problem by adding a:

import 'core-js/modules/es6.typed.array-buffer';
@existentialism
Copy link
Member

@paulroper IIRC, early on @hzoo and I were looking for a clearer mapping for ArrayBuffer in the compat-table data and probably just forgot :)

Thanks for the report, I think it makes sense to include the polyfill via ArrayBuffer[Symbol.species] support.

@existentialism
Copy link
Member

@paulroper v1.3.1 should include core-js arraybuffer properly, see this test:

https://github.com/babel/babel-preset-env/tree/master/test/fixtures/preset-options/use-builtins-ie-9

Thanks again for the report!

@paulroper
Copy link
Author

Amazing, thank you for responding so quickly! We'll get that into our codebase as soon as we can

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants