codecombat/esper.js

Cannot load core-js

ngocdaothanh opened this issue · 2 comments

core-js is a popular ES6 polyfill:
https://github.com/zloirock/core-js

For example, it's used in Babel:
https://babeljs.io/docs/en/babel-preset-env

I've used rollup:
https://github.com/ngocdaothanh/one-core-js

To merge all ES6 polyfill files:
https://github.com/zloirock/core-js/blob/master/packages/core-js/es/index.js

Into this one file:
https://github.com/ngocdaothanh/one-core-js/blob/master/es6polyfills.js

When esper.js loads that file, there's error:
Cant index propertyIsEnumerable of undefined

The error is thrown from here:
https://github.com/codecombat/esper.js/blob/master/src/Evaluator.js#L406

Would you please investigate and fix the error?

Is there any particular ES6 feature you are looking for? It might be easier to just implement that feature instead of trying to get a complicated polyfill to load.

I want some basic commonly used ES6 features like Array.from.

esper.js cannot load when cherry picking Array.from from core-js:
https://github.com/zloirock/core-js/blob/master/packages/core-js/es/array/from.js

esper.js cannot load es6-shim either:
https://github.com/paulmillr/es6-shim

This simple polyfill works however:
https://gist.github.com/brettz9/4212262

It would be perfect (ES6 feature complete) if esper.js can load popular ES6 polyfills.