Skip to content

Commit

Permalink
Merge pull request #1317 from bolt-design-system/hotfix/ie11-access-d…
Browse files Browse the repository at this point in the history
…enied-with-pollyfills

Hotfix | IE11 | "Access Denied" in getOwnPropertyNames
  • Loading branch information
sghoweri committed Aug 8, 2019
2 parents 2a87d19 + 238f8ad commit 24e6968
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -34,7 +34,9 @@
],
"nohoist": [
"lazysizes",
"**/lazysizes"
"**/lazysizes",
"get-own-property-symbols",
"**/get-own-property-symbols"
]
},
"scripts": {
Expand Down
26 changes: 26 additions & 0 deletions packages/core/.patches/get-own-property-symbols+0.9.2.patch
@@ -0,0 +1,26 @@
diff --git a/node_modules/get-own-property-symbols/build/get-own-property-symbols.max.js b/node_modules/get-own-property-symbols/build/get-own-property-symbols.max.js
index 02ddd12..2a3c1d1 100644
--- a/node_modules/get-own-property-symbols/build/get-own-property-symbols.max.js
+++ b/node_modules/get-own-property-symbols/build/get-own-property-symbols.max.js
@@ -153,7 +153,21 @@ THE SOFTWARE.
descriptor.value = $getOwnPropertySymbols;
defineProperty(Object, GOPS, descriptor);

+ /**
+ * @see https://github.com/aurelia/polyfills/pull/52/files
+ */
+ var cachedWindowNames = typeof window === 'object' ? Object.getOwnPropertyNames(window) : [];
+ var originalObjectGetOwnPropertyNames = Object.getOwnPropertyNames;
descriptor.value = function getOwnPropertyNames(o) {
+ if (toString.call(o) === '[object Window]') {
+ try {
+ return originalObjectGetOwnPropertyNames(o);
+ } catch (e) {
+ // IE bug where layout engine calls userland gOPN for cross-domain "window" objects
+ return [].concat([], cachedWindowNames);
+ }
+ }
+
return gOPN(o).filter(onlyNonSymbols);
};
defineProperty(Object, GOPN, descriptor);
5 changes: 5 additions & 0 deletions packages/core/package.json
Expand Up @@ -22,6 +22,8 @@
"es6-promise": "^4.2.8",
"get-own-property-symbols": "^0.9.3",
"html-element": "^2.3.0",
"patch-package": "^6.1.2",
"postinstall-postinstall": "^2.0.0",
"lit-element": "^2.2.0",
"lit-html": "^1.1.1",
"lodash.merge": "^4.6.2",
Expand All @@ -37,6 +39,9 @@
"skatejs": "^5.2.4",
"smoothscroll-polyfill": "^0.4.4"
},
"scripts": {
"postinstall": "patch-package --patch-dir .patches/"
},
"bugs": "https://github.com/bolt-design-system/bolt/issues",
"homepage": "https://boltdesignsystem.com",
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Expand Up @@ -14901,7 +14901,7 @@ passwd-user@^2.1.0:

patch-package@^6.0.5, patch-package@^6.1.2:
version "6.1.2"
resolved "https://registry.npmjs.org/patch-package/-/patch-package-6.1.2.tgz#9ed0b3defb5c34ecbef3f334ddfb13e01b3d3ff6"
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.1.2.tgz#9ed0b3defb5c34ecbef3f334ddfb13e01b3d3ff6"
integrity sha512-5GnzR8lEyeleeariG+hGabUnD2b1yL7AIGFjlLo95zMGRWhZCel58IpeKD46wwPb7i+uNhUI8unV56ogk8Bgqg==
dependencies:
"@yarnpkg/lockfile" "^1.1.0"
Expand Down Expand Up @@ -15733,7 +15733,7 @@ postcss@^6.0.14:

postinstall-postinstall@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/postinstall-postinstall/-/postinstall-postinstall-2.0.0.tgz#7ba6711b4420575c4f561638836a81faad47f43f"
resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.0.0.tgz#7ba6711b4420575c4f561638836a81faad47f43f"
integrity sha512-3f6qWexsHiT4WKtZc5DRb0FPLilHtARi5KpY4fqban/DJNn8/YhZH8U7dVKVz51WbOxEnR31gV+qYQhvEdHtdQ==

preact-compat@3.19.0, preact-compat@^3.19.0:
Expand Down

0 comments on commit 24e6968

Please sign in to comment.