[Bug 28544] Custom elements should not upgrade elements by setting prototype

https://www.w3.org/Bugs/Public/show_bug.cgi?id=28544

--- Comment #5 from Domenic Denicola <d@domenic.me> ---
It is correct that (2) will not execute until (1) is done executing. But (1)
simply creates a dummy myClass binding which will cause ReferenceErrors if
executed before myClass's definition is evaluated. myClass's definition may or
may not be evaluated by executing (1).

Here is a simple example:

// a.js
import * as bModule from './b.js';
import { b } from './b.js';

// bModule is a dummy module with no properties
// if b is referenced it will cause a ReferenceError
// console.log(b); // fails

export let a = 1;

setTimeout(() => {
  // bModule is no longer a dummy module and has a b property
  // b can be referenced without errors
  console.log(b); // works
}, 100);

////////

// b.js
import * as aModule from './a.js';
import { a } from './a.js';

export let b = 2;

////////

// entry.js
import './b.js';

Execution order is entry.js -> a.js -> b.js. Thus inside a.js we have the dummy
module which later gets upgraded. In fact this happens for a.js (and entry.js)
as well, but you don't observe that since you can't see them pre-upgrade.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 23 April 2015 01:23:25 UTC