88 * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
99 */
1010
11+ /*
12+ Original TypeScript source code used in this test suite:
13+
14+ class XTypescript extends HTMLElement {}
15+ class XTypescript2 extends HTMLElement {}
16+
17+ */
1118suite ( 'TypeScript ES5 Output' , function ( ) {
1219
1320 customElements . enableFlush = true ;
1421
15- // Fails because the XTypescript constructor does not return the result of
16- // the super call. See: https://github.com/Microsoft/TypeScript/issues/7574
17- test . skip ( 'TypeScript generated ES5 works via new()' , function ( ) {
18- var __extends = ( this && this . __extends ) || function ( d , b ) {
19- for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ;
20- function __ ( ) { this . constructor = d ; }
21- d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
22- } ;
23- var XTypescript = ( function ( _super ) {
22+ test ( 'TypeScript generated ES5 works via new()' , function ( ) {
23+ var __extends = ( this && this . __extends ) || ( function ( ) {
24+ var extendStatics = Object . setPrototypeOf ||
25+ ( { __proto__ : [ ] } instanceof Array && function ( d , b ) { d . __proto__ = b ; } ) ||
26+ function ( d , b ) { for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ; } ;
27+ return function ( d , b ) {
28+ extendStatics ( d , b ) ;
29+ function __ ( ) { this . constructor = d ; }
30+ d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
31+ } ;
32+ } ) ( ) ;
33+ var XTypescript = /** @class */ ( function ( _super ) {
2434 __extends ( XTypescript , _super ) ;
2535 function XTypescript ( ) {
26- _super . call ( this ) ;
36+ return _super !== null && _super . apply ( this , arguments ) || this ;
2737 }
2838 return XTypescript ;
2939 } ( HTMLElement ) ) ;
@@ -38,16 +48,21 @@ suite('TypeScript ES5 Output', function() {
3848 assert . instanceOf ( e , XTypescript ) ;
3949 } ) ;
4050
41- test . skip ( 'TypeScript generated ES5 works via createElement' , function ( ) {
42- var __extends = ( this && this . __extends ) || function ( d , b ) {
43- for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ;
44- function __ ( ) { this . constructor = d ; }
45- d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
46- } ;
47- var XTypescript2 = ( function ( _super ) {
51+ test ( 'TypeScript generated ES5 works via createElement' , function ( ) {
52+ var __extends = ( this && this . __extends ) || ( function ( ) {
53+ var extendStatics = Object . setPrototypeOf ||
54+ ( { __proto__ : [ ] } instanceof Array && function ( d , b ) { d . __proto__ = b ; } ) ||
55+ function ( d , b ) { for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ; } ;
56+ return function ( d , b ) {
57+ extendStatics ( d , b ) ;
58+ function __ ( ) { this . constructor = d ; }
59+ d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
60+ } ;
61+ } ) ( ) ;
62+ var XTypescript2 = /** @class */ ( function ( _super ) {
4863 __extends ( XTypescript2 , _super ) ;
4964 function XTypescript2 ( ) {
50- _super . call ( this ) ;
65+ return _super !== null && _super . apply ( this , arguments ) || this ;
5166 }
5267 return XTypescript2 ;
5368 } ( HTMLElement ) ) ;
0 commit comments