Skip to content
This repository was archived by the owner on Oct 26, 2021. It is now read-only.

Commit da8dd80

Browse files
committed
Fix propertyDescriptor of HTMLElement.prototype.constructor for Safari 9
1 parent 0bc74f4 commit da8dd80

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

custom-elements.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

custom-elements.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Patch/HTMLElement.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ export default function(internals) {
4848
}
4949

5050
HTMLElement.prototype = Native.HTMLElement.prototype;
51+
// Safari 9 has `writable: false` on the propertyDescriptor
52+
// Make it writable so that TypeScript can patch up the
53+
// constructor in the ES5 compiled code.
54+
Object.defineProperty(HTMLElement.prototype, 'constructor', {
55+
writable: true,
56+
configurable: true,
57+
enumerable: false,
58+
value: HTMLElement
59+
});
5160

5261
return HTMLElement;
5362
})();

0 commit comments

Comments
 (0)