Skip to content

Instantly share code, notes, and snippets.

@FabioAntunes
Created March 26, 2018 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FabioAntunes/e7577dbcff4f69bf7f3be485c34b8492 to your computer and use it in GitHub Desktop.
Save FabioAntunes/e7577dbcff4f69bf7f3be485c34b8492 to your computer and use it in GitHub Desktop.
Realm proposal exam ple
let realm = new Realm();
let outerGlobal = window;
let innerGlobal = realm.global;
let f = realm.evalScript("(function() { return 17 })");
f() === 17 // true
Reflect.getPrototypeOf(f) === outerGlobal.Function.prototype // false
Reflect.getPrototypeOf(f) === innerGlobal.Function.prototype // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment