Accept new baselines

This commit is contained in:
Anders Hejlsberg
2017-02-01 11:37:33 -08:00
parent a8de5ce836
commit 3a0a58d2e2
3 changed files with 61 additions and 0 deletions

View File

@@ -55,6 +55,14 @@ class Thing3 extends Thing2 {
this.print();
}
}
// Repro from #13805
const Timestamped = <CT extends Constructor<object>>(Base: CT) => {
return class extends Base {
timestamp = new Date();
};
}
//// [mixinClassesAnonymous.js]
@@ -138,3 +146,15 @@ var Thing3 = (function (_super) {
};
return Thing3;
}(Thing2));
// Repro from #13805
var Timestamped = function (Base) {
return (function (_super) {
__extends(class_2, _super);
function class_2() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.timestamp = new Date();
return _this;
}
return class_2;
}(Base));
};

View File

@@ -167,3 +167,22 @@ class Thing3 extends Thing2 {
}
}
// Repro from #13805
const Timestamped = <CT extends Constructor<object>>(Base: CT) => {
>Timestamped : Symbol(Timestamped, Decl(mixinClassesAnonymous.ts, 59, 5))
>CT : Symbol(CT, Decl(mixinClassesAnonymous.ts, 59, 21))
>Constructor : Symbol(Constructor, Decl(mixinClassesAnonymous.ts, 0, 0))
>Base : Symbol(Base, Decl(mixinClassesAnonymous.ts, 59, 53))
>CT : Symbol(CT, Decl(mixinClassesAnonymous.ts, 59, 21))
return class extends Base {
>Base : Symbol(Base, Decl(mixinClassesAnonymous.ts, 59, 53))
timestamp = new Date();
>timestamp : Symbol((Anonymous class).timestamp, Decl(mixinClassesAnonymous.ts, 60, 31))
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
};
}

View File

@@ -198,3 +198,25 @@ class Thing3 extends Thing2 {
}
}
// Repro from #13805
const Timestamped = <CT extends Constructor<object>>(Base: CT) => {
>Timestamped : <CT extends Constructor<object>>(Base: CT) => { new (...args: any[]): (Anonymous class); prototype: <any>.(Anonymous class); } & CT
><CT extends Constructor<object>>(Base: CT) => { return class extends Base { timestamp = new Date(); };} : <CT extends Constructor<object>>(Base: CT) => { new (...args: any[]): (Anonymous class); prototype: <any>.(Anonymous class); } & CT
>CT : CT
>Constructor : Constructor<T>
>Base : CT
>CT : CT
return class extends Base {
>class extends Base { timestamp = new Date(); } : { new (...args: any[]): (Anonymous class); prototype: <any>.(Anonymous class); } & CT
>Base : object
timestamp = new Date();
>timestamp : Date
>new Date() : Date
>Date : DateConstructor
};
}