Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1317 from bolt-design-system/hotfix/ie11-access-d…
…enied-with-pollyfills Hotfix | IE11 | "Access Denied" in getOwnPropertyNames
- Loading branch information
Showing
4 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/core/.patches/get-own-property-symbols+0.9.2.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters