Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <script> | 1 <script> |
| 2 'use strict'; | 2 'use strict'; |
| 3 | 3 |
| 4 let constructors = []; | 4 let constructors = []; |
| 5 | 5 |
| 6 test(() => { | 6 test(() => { |
| 7 assert_equals(constructors.length, 0); | 7 assert_equals(constructors.length, 0); |
| 8 | 8 |
| 9 class MyElement extends HTMLElement { | 9 class MyElement extends HTMLElement { |
| 10 constructor() { | 10 constructor() { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 | 24 |
| 25 // TODO(kochi): crbug.com/640465 createElement returns wrong ownerDocument | 25 // TODO(kochi): crbug.com/640465 createElement returns wrong ownerDocument |
| 26 // createElement should work in imported document. | 26 // createElement should work in imported document. |
| 27 let b = importDoc.createElement('a-a') | 27 let b = importDoc.createElement('a-a') |
| 28 assert_equals(b.ownerDocument, importDoc); | 28 assert_equals(b.ownerDocument, importDoc); |
| 29 assert_equals(constructors.length, 2); | 29 assert_equals(constructors.length, 2); |
| 30 | 30 |
| 31 // new MyElement() should synchronously call constructor. | 31 // new MyElement() should synchronously call constructor. |
| 32 let c = new MyElement(); | 32 let c = new MyElement(); |
| 33 assert_equals(c.ownerDocument, document); | 33 assert_equals(c.ownerDocument, document); |
| 34 assert_equals(constructors.length, e); | 34 assert_equals(constructors.length, 3); |
|
kochi
2016/08/25 06:18:32
This was a critical typo.
| |
| 35 | 35 |
| 36 assert_array_equals(constructors, [a, b, c]); | 36 assert_array_equals(constructors, [a, b, c]); |
| 37 }, 'createElement() and new MyElement should work in imported document.'); | 37 }, 'createElement() and new MyElement should work in imported document.'); |
| 38 </script> | 38 </script> |
| OLD | NEW |