Skip to content

Instantly share code, notes, and snippets.

@Ginden

Ginden/Polyfill.js

Last active Oct 24, 2017
Embed
What would you like to do?
const REALM = Symbol();
Object.define(HTMLElement.prototype, 'realm', {
get() {
if (!Reflect.has(this, REALM)) this[REALM] = window; // Your construction logic goes here
return this[REALM];
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment