How to read this demo

  • Left side: parent window log
  • Middle: iframe containing code in this same folder & log
  • Log output: Object Dumps as key:value-pairs. Item prefixed X means that property is not inherited (hasOwnProperty(k)==true)
  • Normal mode
    • parent window creates object & object.__proto__
      Later, attempts to change the prototype & prints out properties
    • child window looks for its parent' object, and creates a private one sharing that same __proto__
      Later, prints out properties again to see if parent's changes came through
    Works!
  • Userscript mode (Install the same code as a script)
    Same tests are run 2 seconds later. Log windows prefixed with Userscript note
    Something in the child frames' code goes wrong!
    When makeInst combines 2 perfectly sane-looking source objects,the resulting dest object does not even have the correct OwnProperties.
    Later modifying the __proto__ leads to the object forgetting its former own property altogether..
  • Intended: no differenc between both results OR errors, NOT weird behaviour