Merge branch 'master' into object-spread

This commit is contained in:
Nathan Shively-Sanders
2016-10-03 15:21:25 -07:00
923 changed files with 22308 additions and 8403 deletions

View File

@@ -0,0 +1,36 @@
// @target: es5
// @sourcemap: true
class C {
cProp = 10;
foo() { return "this never gets used."; }
constructor(value: number) {
return {
cProp: value,
foo() {
return "well this looks kinda C-ish.";
}
}
}
}
class D extends C {
dProp = () => this;
constructor(a = 100) {
super(a);
if (Math.random() < 0.5) {
"You win!"
return {
cProp: 1,
dProp: () => this,
foo() { return "You win!!!!!" }
};
}
else
return null;
}
}

View File

@@ -0,0 +1,39 @@
// @target: es5
// @module: es2015
export class C {
}
export namespace C {
export const x = 1;
}
export enum E {
w = 1
}
export enum E {
x = 2
}
export namespace E {
export const y = 1;
}
export namespace E {
export const z = 1;
}
export namespace N {
}
export namespace N {
export const x = 1;
}
export function F() {
}
export namespace F {
export const x = 1;
}

View File

@@ -0,0 +1,2 @@
function f() {
export = 0;

View File

@@ -0,0 +1,8 @@
// @target: es5
// https://github.com/Microsoft/TypeScript/issues/11236
while (true)
{
let local = null;
var a = () => local; // <-- Lambda should be converted to function()
}

View File

@@ -0,0 +1,23 @@
// @target es5
// Original test intent:
// When arrow functions capture 'this', the lexical 'this' owner
// currently captures 'this' using a variable named '_this'.
// That means that '_this' becomes a reserved identifier in certain places.
//
// Constructors have adopted the same identifier name ('_this')
// for capturing any potential return values from super calls,
// so we expect the same behavior.
class C {
constructor() {
return {};
}
}
class D extends C {
constructor() {
var _this = "uh-oh?";
super();
}
}

View File

@@ -0,0 +1,17 @@
// @target es5
// Original test intent:
// Errors on '_this' should be reported in derived constructors,
// even if 'super()' is not called.
class C {
constructor() {
return {};
}
}
class D extends C {
constructor() {
var _this = "uh-oh?";
}
}

View File

@@ -0,0 +1,14 @@
// @noImplicitReturns: true
function f() {
let x = 100;
try {
throw "WAT"
}
catch (e) {
}
finally {
return x;
}
}