es-shims / es5-shim

ECMAScript 5 compatibility shims for legacy (and modern) JavaScript engines
MIT License
7.12k stars 899 forks source link

Opera < 11 shows error when loading shams #448

Closed Xotic750 closed 7 years ago

Xotic750 commented 7 years ago

ES5-shim is loaded first, then ES5-sham:

Uncaught exception: TypeError: Cannot convert 'iframe.contentWindow' to object
Error thrown at line 259, column 12 in getEmptyViaIFrame() in https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-sham.js:
    empty = iframe.contentWindow.Object.prototype;
called from line 280, column 16 in <anonymous function: createEmpty>() in https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-sham.js:
    var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame();
called from line 306, column 16 in create(prototype, properties) in https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.9/es5-sham.js:
    object = createEmpty();
called from line 1595, column 2 in <anonymous function>() in https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.3/es6-shim.js:
    if (Object.setPrototypeOf && Object.getPrototypeOf &&
called from line 25, column 4 in <anonymous function>(root, factory) in https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.3/es6-shim.js:
    root.returnExports = factory();
called from line 13, column 0 in https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.3/es6-shim.js:
    (function (root, factory) {

Not sure if this means that the shams are not loaded at all, or if just specific part (Object.create) is not working?

Xotic750 commented 7 years ago

I'm pretty sure they are not loading, as ES6-shim doesn't implement Reflect.ownKeys when loaded afterwards.

Xotic750 commented 7 years ago

Seems that you have this in https://github.com/es-shims/es5-shim/issues/367