mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #1975 from Microsoft/multiLineEmit2
Provide specialized functions for emitting the body of a function depending on if that body is an expression or a block.
This commit is contained in:
+167
-112
@@ -1758,8 +1758,8 @@ module ts {
|
||||
lastRecordedSourceMapSpan.emittedLine != emittedLine ||
|
||||
lastRecordedSourceMapSpan.emittedColumn != emittedColumn ||
|
||||
(lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex &&
|
||||
(lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line ||
|
||||
(lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) {
|
||||
(lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line ||
|
||||
(lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) {
|
||||
// Encode the last recordedSpan before assigning new
|
||||
encodeLastRecordedSourceMapSpan();
|
||||
|
||||
@@ -2080,6 +2080,52 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitLinePreservingList(parent: Node, nodes: NodeArray<Node>, allowTrailingComma: boolean, spacesBetweenBraces: boolean) {
|
||||
Debug.assert(nodes.length > 0);
|
||||
|
||||
increaseIndent();
|
||||
|
||||
if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) {
|
||||
if (spacesBetweenBraces) {
|
||||
write(" ");
|
||||
}
|
||||
}
|
||||
else {
|
||||
writeLine();
|
||||
}
|
||||
|
||||
for (var i = 0, n = nodes.length; i < n; i++) {
|
||||
if (i) {
|
||||
if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) {
|
||||
write(", ");
|
||||
}
|
||||
else {
|
||||
write(",");
|
||||
writeLine();
|
||||
}
|
||||
}
|
||||
|
||||
emit(nodes[i]);
|
||||
}
|
||||
|
||||
var closeTokenIsOnSameLineAsLastElement = nodeEndPositionsAreOnSameLine(parent, lastOrUndefined(nodes));
|
||||
|
||||
if (nodes.hasTrailingComma && allowTrailingComma) {
|
||||
write(",");
|
||||
}
|
||||
|
||||
decreaseIndent();
|
||||
|
||||
if (closeTokenIsOnSameLineAsLastElement) {
|
||||
if (spacesBetweenBraces) {
|
||||
write(" ");
|
||||
}
|
||||
}
|
||||
else {
|
||||
writeLine();
|
||||
}
|
||||
}
|
||||
|
||||
function emitList(nodes: Node[], start: number, count: number, multiLine: boolean, trailingComma: boolean) {
|
||||
for (var i = 0; i < count; i++) {
|
||||
if (multiLine) {
|
||||
@@ -2135,7 +2181,7 @@ module ts {
|
||||
function emitLiteral(node: LiteralExpression) {
|
||||
var text = languageVersion < ScriptTarget.ES6 && isTemplateLiteralKind(node.kind) ? getTemplateLiteralAsStringLiteral(node) :
|
||||
node.parent ? getSourceTextOfNodeFromSourceFile(currentSourceFile, node) :
|
||||
node.text;
|
||||
node.text;
|
||||
if (compilerOptions.sourceMap && (node.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(node.kind))) {
|
||||
writer.writeLiteral(text);
|
||||
}
|
||||
@@ -2480,22 +2526,18 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function isSpreadElementExpression(node: Node) {
|
||||
return node.kind === SyntaxKind.SpreadElementExpression;
|
||||
}
|
||||
|
||||
function emitArrayLiteral(node: ArrayLiteralExpression) {
|
||||
var elements = node.elements;
|
||||
if (elements.length === 0) {
|
||||
write("[]");
|
||||
}
|
||||
else if (languageVersion >= ScriptTarget.ES6) {
|
||||
else if (languageVersion >= ScriptTarget.ES6 || !forEach(elements, isSpreadElementExpression)) {
|
||||
write("[");
|
||||
var multiLine = (node.flags & NodeFlags.MultiLine) !== 0;
|
||||
if (multiLine) {
|
||||
increaseIndent();
|
||||
}
|
||||
emitList(elements, 0, elements.length, /*multiLine*/ multiLine,
|
||||
/*trailingComma*/ elements.hasTrailingComma);
|
||||
if (multiLine) {
|
||||
decreaseIndent();
|
||||
}
|
||||
emitLinePreservingList(node, node.elements, elements.hasTrailingComma, /*spacesBetweenBraces:*/ false);
|
||||
write("]");
|
||||
}
|
||||
else {
|
||||
@@ -2504,32 +2546,6 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitObjectLiteralBody(node: ObjectLiteralExpression, numElements: number) {
|
||||
write("{");
|
||||
|
||||
var multiLine = (node.flags & NodeFlags.MultiLine) !== 0;
|
||||
|
||||
if (numElements > 0) {
|
||||
var properties = node.properties;
|
||||
if (!multiLine) {
|
||||
write(" ");
|
||||
}
|
||||
else {
|
||||
increaseIndent();
|
||||
}
|
||||
emitList(properties, 0, numElements, /*multiLine*/ multiLine,
|
||||
/*trailingComma*/ properties.hasTrailingComma && languageVersion >= ScriptTarget.ES5);
|
||||
if (!multiLine) {
|
||||
write(" ");
|
||||
}
|
||||
else {
|
||||
decreaseIndent();
|
||||
}
|
||||
}
|
||||
|
||||
write("}");
|
||||
}
|
||||
|
||||
function createSynthesizedNode(kind: SyntaxKind): Node {
|
||||
var node = createNode(kind);
|
||||
node.pos = -1;
|
||||
@@ -2759,7 +2775,14 @@ module ts {
|
||||
|
||||
// Ordinary case: either the object has no computed properties
|
||||
// or we're compiling with an ES6+ target.
|
||||
emitObjectLiteralBody(node, properties.length);
|
||||
write("{");
|
||||
|
||||
var properties = node.properties;
|
||||
if (properties.length) {
|
||||
emitLinePreservingList(node, properties, /*allowTrailingComma:*/ languageVersion >= ScriptTarget.ES5, /*spacesBetweenBraces:*/ true)
|
||||
}
|
||||
|
||||
write("}");
|
||||
}
|
||||
|
||||
function emitComputedPropertyName(node: ComputedPropertyName) {
|
||||
@@ -3125,7 +3148,7 @@ module ts {
|
||||
emit(node.whenFalse);
|
||||
}
|
||||
|
||||
function isSingleLineBlock(node: Node) {
|
||||
function isSingleLineEmptyBlock(node: Node) {
|
||||
if (node && node.kind === SyntaxKind.Block) {
|
||||
var block = <Block>node;
|
||||
return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block);
|
||||
@@ -3133,7 +3156,7 @@ module ts {
|
||||
}
|
||||
|
||||
function emitBlock(node: Block) {
|
||||
if (isSingleLineBlock(node)) {
|
||||
if (isSingleLineEmptyBlock(node)) {
|
||||
emitToken(SyntaxKind.OpenBraceToken, node.pos);
|
||||
write(" ");
|
||||
emitToken(SyntaxKind.CloseBraceToken, node.statements.end);
|
||||
@@ -3313,11 +3336,16 @@ module ts {
|
||||
emitToken(SyntaxKind.CloseBraceToken, node.clauses.end);
|
||||
}
|
||||
|
||||
function isOnSameLine(node1: Node, node2: Node) {
|
||||
function nodeStartPositionsAreOnSameLine(node1: Node, node2: Node) {
|
||||
return getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node1.pos)) ===
|
||||
getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node2.pos));
|
||||
}
|
||||
|
||||
function nodeEndPositionsAreOnSameLine(node1: Node, node2: Node) {
|
||||
return getLineOfLocalPosition(currentSourceFile, node1.end) ===
|
||||
getLineOfLocalPosition(currentSourceFile, node2.end);
|
||||
}
|
||||
|
||||
function nodeEndIsOnSameLineAsNodeStart(node1: Node, node2: Node) {
|
||||
return getLineOfLocalPosition(currentSourceFile, node1.end) ===
|
||||
getLineOfLocalPosition(currentSourceFile, skipTrivia(currentSourceFile.text, node2.pos));
|
||||
@@ -3332,7 +3360,7 @@ module ts {
|
||||
else {
|
||||
write("default:");
|
||||
}
|
||||
if (node.statements.length === 1 && isOnSameLine(node, node.statements[0])) {
|
||||
if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) {
|
||||
write(" ");
|
||||
emit(node.statements[0]);
|
||||
}
|
||||
@@ -3822,77 +3850,14 @@ module ts {
|
||||
emitSignatureParameters(node);
|
||||
}
|
||||
|
||||
if (isSingleLineBlock(node.body)) {
|
||||
if (isSingleLineEmptyBlock(node.body) || !node.body) {
|
||||
write(" { }");
|
||||
}
|
||||
else if (node.body.kind === SyntaxKind.Block) {
|
||||
emitBlockFunctionBody(node, <Block>node.body);
|
||||
}
|
||||
else {
|
||||
write(" {");
|
||||
scopeEmitStart(node);
|
||||
|
||||
if (!node.body) {
|
||||
writeLine();
|
||||
write("}");
|
||||
}
|
||||
else {
|
||||
increaseIndent();
|
||||
|
||||
emitDetachedComments(node.body.kind === SyntaxKind.Block ? (<Block>node.body).statements : node.body);
|
||||
|
||||
var startIndex = 0;
|
||||
if (node.body.kind === SyntaxKind.Block) {
|
||||
startIndex = emitDirectivePrologues((<Block>node.body).statements, /*startWithNewLine*/ true);
|
||||
}
|
||||
var outPos = writer.getTextPos();
|
||||
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitDefaultValueAssignments(node);
|
||||
emitRestParameter(node);
|
||||
if (node.body.kind !== SyntaxKind.Block && outPos === writer.getTextPos()) {
|
||||
decreaseIndent();
|
||||
write(" ");
|
||||
emitStart(node.body);
|
||||
write("return ");
|
||||
|
||||
// Don't emit comments on this body. We'll have already taken care of it above
|
||||
// when we called emitDetachedComments.
|
||||
emitNode(node.body, /*disableComments:*/ true);
|
||||
emitEnd(node.body);
|
||||
write(";");
|
||||
emitTempDeclarations(/*newLine*/ false);
|
||||
write(" ");
|
||||
emitStart(node.body);
|
||||
write("}");
|
||||
emitEnd(node.body);
|
||||
}
|
||||
else {
|
||||
if (node.body.kind === SyntaxKind.Block) {
|
||||
emitLinesStartingAt((<Block>node.body).statements, startIndex);
|
||||
}
|
||||
else {
|
||||
writeLine();
|
||||
emitLeadingComments(node.body);
|
||||
write("return ");
|
||||
emit(node.body, /*disableComments:*/ true);
|
||||
write(";");
|
||||
emitTrailingComments(node.body);
|
||||
}
|
||||
emitTempDeclarations(/*newLine*/ true);
|
||||
writeLine();
|
||||
if (node.body.kind === SyntaxKind.Block) {
|
||||
emitLeadingCommentsOfPosition((<Block>node.body).statements.end);
|
||||
decreaseIndent();
|
||||
emitToken(SyntaxKind.CloseBraceToken, (<Block>node.body).statements.end);
|
||||
}
|
||||
else {
|
||||
decreaseIndent();
|
||||
emitStart(node.body);
|
||||
write("}");
|
||||
emitEnd(node.body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scopeEmitEnd();
|
||||
emitExpressionFunctionBody(node, <Expression>node.body);
|
||||
}
|
||||
|
||||
if (node.flags & NodeFlags.Export) {
|
||||
@@ -3904,11 +3869,101 @@ module ts {
|
||||
emitEnd(node);
|
||||
write(";");
|
||||
}
|
||||
|
||||
tempCount = saveTempCount;
|
||||
tempVariables = saveTempVariables;
|
||||
tempParameters = saveTempParameters;
|
||||
}
|
||||
|
||||
// Returns true if any preamble code was emitted.
|
||||
function emitFunctionBodyPreamble(node: FunctionLikeDeclaration): void {
|
||||
emitCaptureThisForNodeIfNecessary(node);
|
||||
emitDefaultValueAssignments(node);
|
||||
emitRestParameter(node);
|
||||
}
|
||||
|
||||
function emitExpressionFunctionBody(node: FunctionLikeDeclaration, body: Expression) {
|
||||
write(" {");
|
||||
scopeEmitStart(node);
|
||||
|
||||
increaseIndent();
|
||||
var outPos = writer.getTextPos();
|
||||
emitDetachedComments(node.body);
|
||||
emitFunctionBodyPreamble(node);
|
||||
var preambleEmitted = writer.getTextPos() !== outPos;
|
||||
decreaseIndent();
|
||||
|
||||
// If we didn't have to emit any preamble code, then attempt to keep the arrow
|
||||
// function on one line.
|
||||
if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) {
|
||||
write(" ");
|
||||
emitStart(body);
|
||||
write("return ");
|
||||
|
||||
// Don't emit comments on this body. We'll have already taken care of it above
|
||||
// when we called emitDetachedComments.
|
||||
emitNode(body, /*disableComments:*/ true);
|
||||
emitEnd(body);
|
||||
write(";");
|
||||
emitTempDeclarations(/*newLine*/ false);
|
||||
write(" ");
|
||||
}
|
||||
else {
|
||||
increaseIndent();
|
||||
writeLine();
|
||||
emitLeadingComments(node.body);
|
||||
write("return ");
|
||||
emit(node.body, /*disableComments:*/ true);
|
||||
write(";");
|
||||
emitTrailingComments(node.body);
|
||||
|
||||
emitTempDeclarations(/*newLine*/ true);
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
}
|
||||
|
||||
emitStart(node.body);
|
||||
write("}");
|
||||
emitEnd(node.body);
|
||||
|
||||
scopeEmitEnd();
|
||||
}
|
||||
|
||||
function emitBlockFunctionBody(node: FunctionLikeDeclaration, body: Block) {
|
||||
write(" {");
|
||||
scopeEmitStart(node);
|
||||
|
||||
var outPos = writer.getTextPos();
|
||||
increaseIndent();
|
||||
emitDetachedComments(body.statements);
|
||||
var startIndex = emitDirectivePrologues(body.statements, /*startWithNewLine*/ true);
|
||||
emitFunctionBodyPreamble(node);
|
||||
decreaseIndent();
|
||||
var preambleEmitted = writer.getTextPos() !== outPos;
|
||||
|
||||
if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) {
|
||||
for (var i = 0, n = body.statements.length; i < n; i++) {
|
||||
write(" ");
|
||||
emit(body.statements[i]);
|
||||
}
|
||||
emitTempDeclarations(/*newLine*/ false);
|
||||
write(" ");
|
||||
emitLeadingCommentsOfPosition(body.statements.end);
|
||||
}
|
||||
else {
|
||||
increaseIndent();
|
||||
emitLinesStartingAt(body.statements, startIndex);
|
||||
emitTempDeclarations(/*newLine*/ true);
|
||||
|
||||
writeLine();
|
||||
emitLeadingCommentsOfPosition(body.statements.end);
|
||||
decreaseIndent();
|
||||
}
|
||||
|
||||
emitToken(SyntaxKind.CloseBraceToken, body.statements.end);
|
||||
scopeEmitEnd();
|
||||
}
|
||||
|
||||
function findInitialSuperCall(ctor: ConstructorDeclaration): ExpressionStatement {
|
||||
if (ctor.body) {
|
||||
var statement = (<Block>ctor.body).statements[0];
|
||||
|
||||
@@ -30,9 +30,7 @@ var Board = (function () {
|
||||
function Board() {
|
||||
}
|
||||
Board.prototype.allShipsSunk = function () {
|
||||
return this.ships.every(function (val) {
|
||||
return val.isSunk;
|
||||
});
|
||||
return this.ships.every(function (val) { return val.isSunk; });
|
||||
};
|
||||
return Board;
|
||||
})();
|
||||
|
||||
@@ -1965,8 +1965,6 @@ function compile(fileNames, options) {
|
||||
}
|
||||
exports.compile = compile;
|
||||
compile(process.argv.slice(2), {
|
||||
noEmitOnError: true,
|
||||
noImplicitAny: true,
|
||||
target: 1 /* ES5 */,
|
||||
module: 1 /* CommonJS */
|
||||
noEmitOnError: true, noImplicitAny: true,
|
||||
target: 1 /* ES5 */, module: 1 /* CommonJS */
|
||||
});
|
||||
|
||||
+1
-3
@@ -19,9 +19,7 @@ module clodule {
|
||||
var clodule = (function () {
|
||||
function clodule() {
|
||||
}
|
||||
clodule.sfn = function (id) {
|
||||
return 42;
|
||||
};
|
||||
clodule.sfn = function (id) { return 42; };
|
||||
return clodule;
|
||||
})();
|
||||
var clodule;
|
||||
|
||||
+4
-12
@@ -28,16 +28,12 @@ var Point = (function () {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
Point.Origin = function () {
|
||||
return { x: 0, y: 0 };
|
||||
}; // unexpected error here bug 840246
|
||||
Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246
|
||||
return Point;
|
||||
})();
|
||||
var Point;
|
||||
(function (Point) {
|
||||
function Origin() {
|
||||
return null;
|
||||
}
|
||||
function Origin() { return null; }
|
||||
Point.Origin = Origin; //expected duplicate identifier error
|
||||
})(Point || (Point = {}));
|
||||
var A;
|
||||
@@ -47,17 +43,13 @@ var A;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
Point.Origin = function () {
|
||||
return { x: 0, y: 0 };
|
||||
}; // unexpected error here bug 840246
|
||||
Point.Origin = function () { return { x: 0, y: 0 }; }; // unexpected error here bug 840246
|
||||
return Point;
|
||||
})();
|
||||
A.Point = Point;
|
||||
var Point;
|
||||
(function (Point) {
|
||||
function Origin() {
|
||||
return "";
|
||||
}
|
||||
function Origin() { return ""; }
|
||||
Point.Origin = Origin; //expected duplicate identifier error
|
||||
})(Point = A.Point || (A.Point = {}));
|
||||
})(A || (A = {}));
|
||||
|
||||
+4
-12
@@ -28,16 +28,12 @@ var Point = (function () {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
Point.Origin = function () {
|
||||
return { x: 0, y: 0 };
|
||||
};
|
||||
Point.Origin = function () { return { x: 0, y: 0 }; };
|
||||
return Point;
|
||||
})();
|
||||
var Point;
|
||||
(function (Point) {
|
||||
function Origin() {
|
||||
return "";
|
||||
} // not an error, since not exported
|
||||
function Origin() { return ""; } // not an error, since not exported
|
||||
})(Point || (Point = {}));
|
||||
var A;
|
||||
(function (A) {
|
||||
@@ -46,16 +42,12 @@ var A;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
Point.Origin = function () {
|
||||
return { x: 0, y: 0 };
|
||||
};
|
||||
Point.Origin = function () { return { x: 0, y: 0 }; };
|
||||
return Point;
|
||||
})();
|
||||
A.Point = Point;
|
||||
var Point;
|
||||
(function (Point) {
|
||||
function Origin() {
|
||||
return "";
|
||||
} // not an error since not exported
|
||||
function Origin() { return ""; } // not an error since not exported
|
||||
})(Point = A.Point || (A.Point = {}));
|
||||
})(A || (A = {}));
|
||||
|
||||
@@ -2,5 +2,4 @@
|
||||
var v = { * }
|
||||
|
||||
//// [FunctionPropertyAssignments4_es6.js]
|
||||
var v = { : function () {
|
||||
} };
|
||||
var v = { : function () { } };
|
||||
|
||||
@@ -7,5 +7,6 @@ var v = { * foo() {
|
||||
|
||||
//// [YieldExpression10_es6.js]
|
||||
var v = { foo: function () {
|
||||
;
|
||||
} };
|
||||
;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
function* foo() { yield }
|
||||
|
||||
//// [YieldExpression13_es6.js]
|
||||
function foo() {
|
||||
;
|
||||
}
|
||||
function foo() { ; }
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
var v = { get foo() { yield foo; } }
|
||||
|
||||
//// [YieldExpression17_es6.js]
|
||||
var v = { get foo() {
|
||||
;
|
||||
} };
|
||||
var v = { get foo() { ; } };
|
||||
|
||||
@@ -52,9 +52,7 @@ var C = (function () {
|
||||
}
|
||||
C.privateMethod = function () { };
|
||||
Object.defineProperty(C, "privateGetter", {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -65,9 +63,7 @@ var C = (function () {
|
||||
});
|
||||
C.protectedMethod = function () { };
|
||||
Object.defineProperty(C, "protectedGetter", {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -78,9 +74,7 @@ var C = (function () {
|
||||
});
|
||||
C.publicMethod = function () { };
|
||||
Object.defineProperty(C, "publicGetter", {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -97,9 +91,7 @@ var D = (function () {
|
||||
}
|
||||
D.privateMethod = function () { };
|
||||
Object.defineProperty(D, "privateGetter", {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -110,9 +102,7 @@ var D = (function () {
|
||||
});
|
||||
D.protectedMethod = function () { };
|
||||
Object.defineProperty(D, "protectedGetter", {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -123,9 +113,7 @@ var D = (function () {
|
||||
});
|
||||
D.publicMethod = function () { };
|
||||
Object.defineProperty(D, "publicGetter", {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -142,9 +130,7 @@ var E = (function () {
|
||||
}
|
||||
E.prototype.method = function () { };
|
||||
Object.defineProperty(E.prototype, "getter", {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -47,9 +47,7 @@ var D = (function () {
|
||||
return D;
|
||||
})();
|
||||
var x = {
|
||||
get a() {
|
||||
return 1;
|
||||
}
|
||||
get a() { return 1; }
|
||||
};
|
||||
var y = {
|
||||
set b(v) { }
|
||||
|
||||
@@ -44,9 +44,7 @@ var D = (function () {
|
||||
return D;
|
||||
})();
|
||||
var x = {
|
||||
get a() {
|
||||
return 1;
|
||||
}
|
||||
get a() { return 1; }
|
||||
};
|
||||
var y = {
|
||||
set b(v) { }
|
||||
|
||||
@@ -2,5 +2,4 @@
|
||||
var v = { get foo() }
|
||||
|
||||
//// [accessorWithoutBody1.js]
|
||||
var v = { get foo() {
|
||||
} };
|
||||
var v = { get foo() { } };
|
||||
|
||||
@@ -2,5 +2,4 @@
|
||||
var v = { set foo(a) }
|
||||
|
||||
//// [accessorWithoutBody2.js]
|
||||
var v = { set foo(a) {
|
||||
} };
|
||||
var v = { set foo(a) { } };
|
||||
|
||||
@@ -11,14 +11,10 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, "x", {
|
||||
get: function () {
|
||||
return 1;
|
||||
},
|
||||
get: function () { return 1; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
return C;
|
||||
})();
|
||||
var y = { get foo() {
|
||||
return 3;
|
||||
} };
|
||||
var y = { get foo() { return 3; } };
|
||||
|
||||
@@ -18,38 +18,26 @@ var LanguageSpec_section_4_5_error_cases = (function () {
|
||||
function LanguageSpec_section_4_5_error_cases() {
|
||||
}
|
||||
Object.defineProperty(LanguageSpec_section_4_5_error_cases.prototype, "AnnotatedSetter_SetterFirst", {
|
||||
get: function () {
|
||||
return "";
|
||||
},
|
||||
get: function () { return ""; },
|
||||
set: function (a) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(LanguageSpec_section_4_5_error_cases.prototype, "AnnotatedSetter_SetterLast", {
|
||||
get: function () {
|
||||
return "";
|
||||
},
|
||||
get: function () { return ""; },
|
||||
set: function (a) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(LanguageSpec_section_4_5_error_cases.prototype, "AnnotatedGetter_GetterFirst", {
|
||||
get: function () {
|
||||
return "";
|
||||
},
|
||||
set: function (aStr) {
|
||||
aStr = 0;
|
||||
},
|
||||
get: function () { return ""; },
|
||||
set: function (aStr) { aStr = 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(LanguageSpec_section_4_5_error_cases.prototype, "AnnotatedGetter_GetterLast", {
|
||||
get: function () {
|
||||
return "";
|
||||
},
|
||||
set: function (aStr) {
|
||||
aStr = 0;
|
||||
},
|
||||
get: function () { return ""; },
|
||||
set: function (aStr) { aStr = 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -47,49 +47,37 @@ var LanguageSpec_section_4_5_inference = (function () {
|
||||
function LanguageSpec_section_4_5_inference() {
|
||||
}
|
||||
Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredGetterFromSetterAnnotation", {
|
||||
get: function () {
|
||||
return new B();
|
||||
},
|
||||
get: function () { return new B(); },
|
||||
set: function (a) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredGetterFromSetterAnnotation_GetterFirst", {
|
||||
get: function () {
|
||||
return new B();
|
||||
},
|
||||
get: function () { return new B(); },
|
||||
set: function (a) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredFromGetter", {
|
||||
get: function () {
|
||||
return new B();
|
||||
},
|
||||
get: function () { return new B(); },
|
||||
set: function (a) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredFromGetter_SetterFirst", {
|
||||
get: function () {
|
||||
return new B();
|
||||
},
|
||||
get: function () { return new B(); },
|
||||
set: function (a) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredSetterFromGetterAnnotation", {
|
||||
get: function () {
|
||||
return new B();
|
||||
},
|
||||
get: function () { return new B(); },
|
||||
set: function (a) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(LanguageSpec_section_4_5_inference.prototype, "InferredSetterFromGetterAnnotation_GetterFirst", {
|
||||
get: function () {
|
||||
return new B();
|
||||
},
|
||||
get: function () { return new B(); },
|
||||
set: function (a) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
||||
@@ -84,6 +84,4 @@ var r16 = a + M;
|
||||
var r17 = a + '';
|
||||
var r18 = a + 123;
|
||||
var r19 = a + { a: '' };
|
||||
var r20 = a + (function (a) {
|
||||
return a;
|
||||
});
|
||||
var r20 = a + (function (a) { return a; });
|
||||
|
||||
@@ -25,9 +25,7 @@ var r11 = null + (() => { });
|
||||
|
||||
//// [additionOperatorWithNullValueAndInvalidOperator.js]
|
||||
// If one operand is the null or undefined value, it is treated as having the type of the other operand.
|
||||
function foo() {
|
||||
return undefined;
|
||||
}
|
||||
function foo() { return undefined; }
|
||||
var a;
|
||||
var b;
|
||||
var c;
|
||||
|
||||
@@ -25,9 +25,7 @@ var r11 = undefined + (() => { });
|
||||
|
||||
//// [additionOperatorWithUndefinedValueAndInvalidOperands.js]
|
||||
// If one operand is the null or undefined value, it is treated as having the type of the other operand.
|
||||
function foo() {
|
||||
return undefined;
|
||||
}
|
||||
function foo() { return undefined; }
|
||||
var a;
|
||||
var b;
|
||||
var c;
|
||||
|
||||
@@ -21,9 +21,7 @@ export var a = function () {
|
||||
//// [aliasUsedAsNameValue_0.js]
|
||||
exports.id;
|
||||
//// [aliasUsedAsNameValue_1.js]
|
||||
function b(a) {
|
||||
return null;
|
||||
}
|
||||
function b(a) { return null; }
|
||||
exports.b = b;
|
||||
//// [aliasUsedAsNameValue_2.js]
|
||||
///<reference path='aliasUsedAsNameValue_0.ts' />
|
||||
|
||||
@@ -5,6 +5,4 @@ function foo() { return null; }
|
||||
|
||||
//// [ambientClassOverloadForFunction.js]
|
||||
;
|
||||
function foo() {
|
||||
return null;
|
||||
}
|
||||
function foo() { return null; }
|
||||
|
||||
@@ -6,9 +6,7 @@ var r3 = <<T>(x: T) => T>f; // ambiguous, appears to the parser as a << operatio
|
||||
|
||||
|
||||
//// [ambiguousGenericAssertion1.js]
|
||||
function f(x) {
|
||||
return null;
|
||||
}
|
||||
function f(x) { return null; }
|
||||
var r = function (x) { return x; };
|
||||
var r2 = f; // valid
|
||||
var r3 = << T > (x), T;
|
||||
|
||||
@@ -12,15 +12,11 @@ var x2: string = foof2("s", null);
|
||||
var y2: number = foof2("s", null);
|
||||
|
||||
//// [ambiguousOverload.js]
|
||||
function foof(bar) {
|
||||
return bar;
|
||||
}
|
||||
function foof(bar) { return bar; }
|
||||
;
|
||||
var x = foof("s", null);
|
||||
var y = foof("s", null);
|
||||
function foof2(bar) {
|
||||
return bar;
|
||||
}
|
||||
function foof2(bar) { return bar; }
|
||||
;
|
||||
var x2 = foof2("s", null);
|
||||
var y2 = foof2("s", null);
|
||||
|
||||
@@ -28,6 +28,4 @@ var M;
|
||||
M.C = C;
|
||||
})(M || (M = {}));
|
||||
var c = new M.C();
|
||||
c.m(function (n) {
|
||||
return "hello: " + n;
|
||||
}, 18);
|
||||
c.m(function (n) { return "hello: " + n; }, 18);
|
||||
|
||||
@@ -27,6 +27,4 @@ paired.reduce(function (b1, b2) {
|
||||
}, []);
|
||||
paired.reduce(function (b3, b4) { return b3.concat({}); }, []);
|
||||
paired.map(function (c1) { return c1.count; });
|
||||
paired.map(function (c2) {
|
||||
return c2.count;
|
||||
});
|
||||
paired.map(function (c2) { return c2.count; });
|
||||
|
||||
@@ -95,12 +95,8 @@ var __extends = this.__extends || function (d, b) {
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
}
|
||||
C1.prototype.IM1 = function () {
|
||||
return null;
|
||||
};
|
||||
C1.prototype.C1M1 = function () {
|
||||
return null;
|
||||
};
|
||||
C1.prototype.IM1 = function () { return null; };
|
||||
C1.prototype.C1M1 = function () { return null; };
|
||||
return C1;
|
||||
})();
|
||||
var C2 = (function (_super) {
|
||||
@@ -108,17 +104,13 @@ var C2 = (function (_super) {
|
||||
function C2() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
C2.prototype.C2M1 = function () {
|
||||
return null;
|
||||
};
|
||||
C2.prototype.C2M1 = function () { return null; };
|
||||
return C2;
|
||||
})(C1);
|
||||
var C3 = (function () {
|
||||
function C3() {
|
||||
}
|
||||
C3.prototype.CM3M1 = function () {
|
||||
return 3;
|
||||
};
|
||||
C3.prototype.CM3M1 = function () { return 3; };
|
||||
return C3;
|
||||
})();
|
||||
/*
|
||||
@@ -138,9 +130,7 @@ var i1 = c1;
|
||||
var c2 = new C2();
|
||||
var c3 = new C3();
|
||||
var o1 = { one: 1 };
|
||||
var f1 = function () {
|
||||
return new C1();
|
||||
};
|
||||
var f1 = function () { return new C1(); };
|
||||
var arr_any = [];
|
||||
var arr_i1 = [];
|
||||
var arr_c1 = [];
|
||||
|
||||
@@ -69,12 +69,8 @@ var __extends = this.__extends || function (d, b) {
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
}
|
||||
C1.prototype.IM1 = function () {
|
||||
return null;
|
||||
};
|
||||
C1.prototype.C1M1 = function () {
|
||||
return null;
|
||||
};
|
||||
C1.prototype.IM1 = function () { return null; };
|
||||
C1.prototype.C1M1 = function () { return null; };
|
||||
return C1;
|
||||
})();
|
||||
var C2 = (function (_super) {
|
||||
@@ -82,17 +78,13 @@ var C2 = (function (_super) {
|
||||
function C2() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
C2.prototype.C2M1 = function () {
|
||||
return null;
|
||||
};
|
||||
C2.prototype.C2M1 = function () { return null; };
|
||||
return C2;
|
||||
})(C1);
|
||||
var C3 = (function () {
|
||||
function C3() {
|
||||
}
|
||||
C3.prototype.CM3M1 = function () {
|
||||
return 3;
|
||||
};
|
||||
C3.prototype.CM3M1 = function () { return 3; };
|
||||
return C3;
|
||||
})();
|
||||
/*
|
||||
@@ -112,9 +104,7 @@ var i1 = c1;
|
||||
var c2 = new C2();
|
||||
var c3 = new C3();
|
||||
var o1 = { one: 1 };
|
||||
var f1 = function () {
|
||||
return new C1();
|
||||
};
|
||||
var f1 = function () { return new C1(); };
|
||||
var arr_any = [];
|
||||
var arr_i1 = [];
|
||||
var arr_c1 = [];
|
||||
@@ -128,9 +118,7 @@ arr_c3 = arr_c2_2; // should be an error - is
|
||||
arr_c3 = arr_c1_2; // should be an error - is
|
||||
arr_c3 = arr_i1_2; // should be an error - is
|
||||
arr_any = f1; // should be an error - is
|
||||
arr_any = function () {
|
||||
return null;
|
||||
}; // should be an error - is
|
||||
arr_any = function () { return null; }; // should be an error - is
|
||||
arr_any = o1; // should be an error - is
|
||||
arr_any = a1; // should be ok - is
|
||||
arr_any = c1; // should be an error - is
|
||||
|
||||
@@ -30,9 +30,7 @@ arr_any = c3; // should be an error - is
|
||||
var C3 = (function () {
|
||||
function C3() {
|
||||
}
|
||||
C3.prototype.CM3M1 = function () {
|
||||
return 3;
|
||||
};
|
||||
C3.prototype.CM3M1 = function () { return 3; };
|
||||
return C3;
|
||||
})();
|
||||
/*
|
||||
@@ -49,7 +47,5 @@ Type 1 of any[]:
|
||||
var c3 = new C3();
|
||||
var o1 = { one: 1 };
|
||||
var arr_any = [];
|
||||
arr_any = function () {
|
||||
return null;
|
||||
}; // should be an error - is
|
||||
arr_any = function () { return null; }; // should be an error - is
|
||||
arr_any = c3; // should be an error - is
|
||||
|
||||
@@ -184,14 +184,10 @@ var M2;
|
||||
// <Identifier>(ParamList) => { ... } is a generic arrow function
|
||||
var generic1 = function (n) { return [n]; };
|
||||
var generic1; // Incorrect error, Bug 829597
|
||||
var generic2 = function (n) {
|
||||
return [n];
|
||||
};
|
||||
var generic2 = function (n) { return [n]; };
|
||||
var generic2;
|
||||
// <Identifier> ((ParamList) => { ... } ) is a type assertion to an arrow function
|
||||
var asserted1 = (function (n) { return [n]; });
|
||||
var asserted1;
|
||||
var asserted2 = (function (n) {
|
||||
return n;
|
||||
});
|
||||
var asserted2 = (function (n) { return n; });
|
||||
var asserted2;
|
||||
|
||||
@@ -91,16 +91,10 @@ function tryCatchFn() {
|
||||
//// [arrowFunctionExpressions.js]
|
||||
// ArrowFormalParameters => AssignmentExpression is equivalent to ArrowFormalParameters => { return AssignmentExpression; }
|
||||
var a = function (p) { return p.length; };
|
||||
var a = function (p) {
|
||||
return p.length;
|
||||
};
|
||||
var a = function (p) { return p.length; };
|
||||
// Identifier => Block is equivalent to(Identifier) => Block
|
||||
var b = function (j) {
|
||||
return 0;
|
||||
};
|
||||
var b = function (j) {
|
||||
return 0;
|
||||
};
|
||||
var b = function (j) { return 0; };
|
||||
var b = function (j) { return 0; };
|
||||
// Identifier => AssignmentExpression is equivalent to(Identifier) => AssignmentExpression
|
||||
var c;
|
||||
var d = function (n) { return c = n; };
|
||||
|
||||
@@ -11,6 +11,4 @@ var C = (function () {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
var c = new C(function () {
|
||||
return asdf;
|
||||
}); // should error
|
||||
var c = new C(function () { return asdf; }); // should error
|
||||
|
||||
@@ -79,24 +79,12 @@ var missingCurliesWithArrow;
|
||||
(function (missingCurliesWithArrow) {
|
||||
var withStatement;
|
||||
(function (withStatement) {
|
||||
var a = function () {
|
||||
var k = 10;
|
||||
};
|
||||
var b = function () {
|
||||
var k = 10;
|
||||
};
|
||||
var c = function (x) {
|
||||
var k = 10;
|
||||
};
|
||||
var d = function (x, y) {
|
||||
var k = 10;
|
||||
};
|
||||
var e = function (x, y) {
|
||||
var k = 10;
|
||||
};
|
||||
var f = function () {
|
||||
var k = 10;
|
||||
};
|
||||
var a = function () { var k = 10; };
|
||||
var b = function () { var k = 10; };
|
||||
var c = function (x) { var k = 10; };
|
||||
var d = function (x, y) { var k = 10; };
|
||||
var e = function (x, y) { var k = 10; };
|
||||
var f = function () { var k = 10; };
|
||||
})(withStatement || (withStatement = {}));
|
||||
var withoutStatement;
|
||||
(function (withoutStatement) {
|
||||
|
||||
@@ -91,12 +91,8 @@ var h;
|
||||
x = h;
|
||||
var i;
|
||||
x = i;
|
||||
x = { f: function () {
|
||||
return 1;
|
||||
} };
|
||||
x = { f: function (x) {
|
||||
return x;
|
||||
} };
|
||||
x = { f: function () { return 1; } };
|
||||
x = { f: function (x) { return x; } };
|
||||
function j(a) {
|
||||
x = a;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,4 @@ fn(function (a, b) { return true; })
|
||||
//// [assignLambdaToNominalSubtypeOfFunction.js]
|
||||
function fn(cb) { }
|
||||
fn(function (a, b) { return true; });
|
||||
fn(function (a, b) {
|
||||
return true;
|
||||
});
|
||||
fn(function (a, b) { return true; });
|
||||
|
||||
@@ -13,8 +13,6 @@ module M {
|
||||
//// [assignToFn.js]
|
||||
var M;
|
||||
(function (M) {
|
||||
var x = { f: function (n) {
|
||||
return true;
|
||||
} };
|
||||
var x = { f: function (n) { return true; } };
|
||||
x.f = "hello";
|
||||
})(M || (M = {}));
|
||||
|
||||
@@ -44,50 +44,28 @@ b2 = { a: 0 }; // error
|
||||
b2 = { b: 0, a: 0 };
|
||||
var b3;
|
||||
b3 = {
|
||||
f: function (n) {
|
||||
return 0;
|
||||
},
|
||||
g: function (s) {
|
||||
return 0;
|
||||
},
|
||||
f: function (n) { return 0; },
|
||||
g: function (s) { return 0; },
|
||||
m: 0
|
||||
}; // ok
|
||||
b3 = {
|
||||
f: function (n) {
|
||||
return 0;
|
||||
},
|
||||
g: function (s) {
|
||||
return 0;
|
||||
}
|
||||
f: function (n) { return 0; },
|
||||
g: function (s) { return 0; }
|
||||
}; // error
|
||||
b3 = {
|
||||
f: function (n) {
|
||||
return 0;
|
||||
},
|
||||
f: function (n) { return 0; },
|
||||
m: 0
|
||||
}; // error
|
||||
b3 = {
|
||||
f: function (n) {
|
||||
return 0;
|
||||
},
|
||||
g: function (s) {
|
||||
return 0;
|
||||
},
|
||||
f: function (n) { return 0; },
|
||||
g: function (s) { return 0; },
|
||||
m: 0,
|
||||
n: 0,
|
||||
k: function (a) {
|
||||
return null;
|
||||
}
|
||||
k: function (a) { return null; }
|
||||
}; // ok
|
||||
b3 = {
|
||||
f: function (n) {
|
||||
return 0;
|
||||
},
|
||||
g: function (s) {
|
||||
return 0;
|
||||
},
|
||||
f: function (n) { return 0; },
|
||||
g: function (s) { return 0; },
|
||||
n: 0,
|
||||
k: function (a) {
|
||||
return null;
|
||||
}
|
||||
k: function (a) { return null; }
|
||||
}; // error
|
||||
|
||||
@@ -28,12 +28,8 @@ foo(x + y);
|
||||
//// [assignmentCompatBug3.js]
|
||||
function makePoint(x, y) {
|
||||
return {
|
||||
get x() {
|
||||
return x;
|
||||
},
|
||||
get y() {
|
||||
return y;
|
||||
},
|
||||
get x() { return x; },
|
||||
get y() { return y; },
|
||||
//x: "yo",
|
||||
//y: "boo",
|
||||
dist: function () {
|
||||
|
||||
@@ -19,6 +19,4 @@ foo2(["s", "t"]);
|
||||
function foo3(x) { }
|
||||
;
|
||||
foo3(function (s) { });
|
||||
foo3(function (n) {
|
||||
return;
|
||||
});
|
||||
foo3(function (n) { return; });
|
||||
|
||||
@@ -22,9 +22,7 @@ var TokenType;
|
||||
})(TokenType || (TokenType = {}));
|
||||
;
|
||||
var list = {};
|
||||
function returnType() {
|
||||
return null;
|
||||
}
|
||||
function returnType() { return null; }
|
||||
function foo() {
|
||||
var x = returnType();
|
||||
var x = list['one'];
|
||||
|
||||
@@ -57,26 +57,18 @@ a = s;
|
||||
a = a2;
|
||||
t = function (x) { return 1; };
|
||||
t = function () { return 1; };
|
||||
t = function (x) {
|
||||
return '';
|
||||
};
|
||||
t = function (x) { return ''; };
|
||||
a = function (x) { return 1; };
|
||||
a = function () { return 1; };
|
||||
a = function (x) {
|
||||
return '';
|
||||
};
|
||||
a = function (x) { return ''; };
|
||||
var s2;
|
||||
var a3;
|
||||
// these are errors
|
||||
t = s2;
|
||||
t = a3;
|
||||
t = function (x) { return 1; };
|
||||
t = function (x) {
|
||||
return '';
|
||||
};
|
||||
t = function (x) { return ''; };
|
||||
a = s2;
|
||||
a = a3;
|
||||
a = function (x) { return 1; };
|
||||
a = function (x) {
|
||||
return '';
|
||||
};
|
||||
a = function (x) { return ''; };
|
||||
|
||||
@@ -64,38 +64,24 @@ a = s;
|
||||
a = a2;
|
||||
t = { f: function () { return 1; } };
|
||||
t = { f: function (x) { return 1; } };
|
||||
t = { f: function f() {
|
||||
return 1;
|
||||
} };
|
||||
t = { f: function (x) {
|
||||
return '';
|
||||
} };
|
||||
t = { f: function f() { return 1; } };
|
||||
t = { f: function (x) { return ''; } };
|
||||
a = { f: function () { return 1; } };
|
||||
a = { f: function (x) { return 1; } };
|
||||
a = { f: function (x) {
|
||||
return '';
|
||||
} };
|
||||
a = { f: function (x) { return ''; } };
|
||||
// errors
|
||||
t = function () { return 1; };
|
||||
t = function (x) {
|
||||
return '';
|
||||
};
|
||||
t = function (x) { return ''; };
|
||||
a = function () { return 1; };
|
||||
a = function (x) {
|
||||
return '';
|
||||
};
|
||||
a = function (x) { return ''; };
|
||||
var s2;
|
||||
var a3;
|
||||
// these are errors
|
||||
t = s2;
|
||||
t = a3;
|
||||
t = function (x) { return 1; };
|
||||
t = function (x) {
|
||||
return '';
|
||||
};
|
||||
t = function (x) { return ''; };
|
||||
a = s2;
|
||||
a = a3;
|
||||
a = function (x) { return 1; };
|
||||
a = function (x) {
|
||||
return '';
|
||||
};
|
||||
a = function (x) { return ''; };
|
||||
|
||||
@@ -54,12 +54,8 @@ var a3;
|
||||
t = s2;
|
||||
t = a3;
|
||||
t = function (x) { return 1; };
|
||||
t = function (x) {
|
||||
return '';
|
||||
};
|
||||
t = function (x) { return ''; };
|
||||
a = s2;
|
||||
a = a3;
|
||||
a = function (x) { return 1; };
|
||||
a = function (x) {
|
||||
return '';
|
||||
};
|
||||
a = function (x) { return ''; };
|
||||
|
||||
@@ -56,25 +56,17 @@ a = s;
|
||||
a = a2;
|
||||
// errors
|
||||
t = function () { return 1; };
|
||||
t = function (x) {
|
||||
return '';
|
||||
};
|
||||
t = function (x) { return ''; };
|
||||
a = function () { return 1; };
|
||||
a = function (x) {
|
||||
return '';
|
||||
};
|
||||
a = function (x) { return ''; };
|
||||
var s2;
|
||||
var a3;
|
||||
// these are errors
|
||||
t = s2;
|
||||
t = a3;
|
||||
t = function (x) { return 1; };
|
||||
t = function (x) {
|
||||
return '';
|
||||
};
|
||||
t = function (x) { return ''; };
|
||||
a = s2;
|
||||
a = a3;
|
||||
a = function (x) { return 1; };
|
||||
a = function (x) {
|
||||
return '';
|
||||
};
|
||||
a = function (x) { return ''; };
|
||||
|
||||
@@ -31,18 +31,10 @@ var d: new(x: number) => void;
|
||||
d = C; // Error
|
||||
|
||||
//// [assignmentCompatWithOverloads.js]
|
||||
function f1(x) {
|
||||
return null;
|
||||
}
|
||||
function f2(x) {
|
||||
return null;
|
||||
}
|
||||
function f3(x) {
|
||||
return null;
|
||||
}
|
||||
function f4(x) {
|
||||
return undefined;
|
||||
}
|
||||
function f1(x) { return null; }
|
||||
function f2(x) { return null; }
|
||||
function f3(x) { return null; }
|
||||
function f4(x) { return undefined; }
|
||||
var g;
|
||||
g = f1; // OK
|
||||
g = f2; // Error
|
||||
|
||||
@@ -19,9 +19,7 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.obj = function f(a) {
|
||||
return a;
|
||||
};
|
||||
__test2__.obj = function f(a) { return a; };
|
||||
;
|
||||
__test2__.__val__obj = __test2__.obj;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -84,17 +84,11 @@ var C = (function () {
|
||||
function C() {
|
||||
this = value;
|
||||
}
|
||||
C.prototype.foo = function () {
|
||||
this = value;
|
||||
};
|
||||
C.sfoo = function () {
|
||||
this = value;
|
||||
};
|
||||
C.prototype.foo = function () { this = value; };
|
||||
C.sfoo = function () { this = value; };
|
||||
return C;
|
||||
})();
|
||||
function foo() {
|
||||
this = value;
|
||||
}
|
||||
function foo() { this = value; }
|
||||
this = value;
|
||||
// identifiers: module, class, enum, function
|
||||
var M;
|
||||
@@ -129,12 +123,8 @@ var Derived = (function (_super) {
|
||||
_super.call(this);
|
||||
_super.prototype. = value;
|
||||
}
|
||||
Derived.prototype.foo = function () {
|
||||
_super.prototype. = value;
|
||||
};
|
||||
Derived.sfoo = function () {
|
||||
_super. = value;
|
||||
};
|
||||
Derived.prototype.foo = function () { _super.prototype. = value; };
|
||||
Derived.sfoo = function () { _super. = value; };
|
||||
return Derived;
|
||||
})(C);
|
||||
// function expression
|
||||
|
||||
@@ -26,15 +26,9 @@ var e3 = t3[2]; // any
|
||||
var e4 = t4[3]; // number
|
||||
|
||||
//// [bestCommonTypeOfTuple.js]
|
||||
function f1(x) {
|
||||
return "foo";
|
||||
}
|
||||
function f2(x) {
|
||||
return 10;
|
||||
}
|
||||
function f3(x) {
|
||||
return true;
|
||||
}
|
||||
function f1(x) { return "foo"; }
|
||||
function f2(x) { return 10; }
|
||||
function f3(x) { return true; }
|
||||
var E1;
|
||||
(function (E1) {
|
||||
E1[E1["one"] = 0] = "one";
|
||||
|
||||
@@ -18,9 +18,5 @@ function f() {
|
||||
return b();
|
||||
return d();
|
||||
}
|
||||
function b() {
|
||||
return null;
|
||||
}
|
||||
function d() {
|
||||
return null;
|
||||
}
|
||||
function b() { return null; }
|
||||
function d() { return null; }
|
||||
|
||||
@@ -41,15 +41,11 @@ var ResultIsNumber8 = ~~BOOLEAN;
|
||||
//// [bitwiseNotOperatorWithBooleanType.js]
|
||||
// ~ operator on boolean type
|
||||
var BOOLEAN;
|
||||
function foo() {
|
||||
return true;
|
||||
}
|
||||
function foo() { return true; }
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.foo = function () {
|
||||
return false;
|
||||
};
|
||||
A.foo = function () { return false; };
|
||||
return A;
|
||||
})();
|
||||
var M;
|
||||
|
||||
@@ -48,15 +48,11 @@ var ResultIsNumber13 = ~~~(NUMBER + NUMBER);
|
||||
// ~ operator on number type
|
||||
var NUMBER;
|
||||
var NUMBER1 = [1, 2];
|
||||
function foo() {
|
||||
return 1;
|
||||
}
|
||||
function foo() { return 1; }
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
A.foo = function () { return 1; };
|
||||
return A;
|
||||
})();
|
||||
var M;
|
||||
@@ -70,9 +66,7 @@ var ResultIsNumber2 = ~NUMBER1;
|
||||
// number type literal
|
||||
var ResultIsNumber3 = ~1;
|
||||
var ResultIsNumber4 = ~{ x: 1, y: 2 };
|
||||
var ResultIsNumber5 = ~{ x: 1, y: function (n) {
|
||||
return n;
|
||||
} };
|
||||
var ResultIsNumber5 = ~{ x: 1, y: function (n) { return n; } };
|
||||
// number type expressions
|
||||
var ResultIsNumber6 = ~objA.a;
|
||||
var ResultIsNumber7 = ~M.n;
|
||||
|
||||
@@ -47,15 +47,11 @@ var ResultIsNumber14 = ~~~(STRING + STRING);
|
||||
// ~ operator on string type
|
||||
var STRING;
|
||||
var STRING1 = ["", "abc"];
|
||||
function foo() {
|
||||
return "abc";
|
||||
}
|
||||
function foo() { return "abc"; }
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.foo = function () {
|
||||
return "";
|
||||
};
|
||||
A.foo = function () { return ""; };
|
||||
return A;
|
||||
})();
|
||||
var M;
|
||||
@@ -69,9 +65,7 @@ var ResultIsNumber2 = ~STRING1;
|
||||
// string type literal
|
||||
var ResultIsNumber3 = ~"";
|
||||
var ResultIsNumber4 = ~{ x: "", y: "" };
|
||||
var ResultIsNumber5 = ~{ x: "", y: function (s) {
|
||||
return s;
|
||||
} };
|
||||
var ResultIsNumber5 = ~{ x: "", y: function (s) { return s; } };
|
||||
// string type expressions
|
||||
var ResultIsNumber6 = ~objA.a;
|
||||
var ResultIsNumber7 = ~M.n;
|
||||
|
||||
@@ -47,14 +47,10 @@ var r7b = i2.f<number, string, number>(1, '');
|
||||
//// [callGenericFunctionWithIncorrectNumberOfTypeArguments.js]
|
||||
// type parameter lists must exactly match type argument lists
|
||||
// all of these invocations are errors
|
||||
function f(x, y) {
|
||||
return null;
|
||||
}
|
||||
function f(x, y) { return null; }
|
||||
var r1 = f(1, '');
|
||||
var r1b = f(1, '');
|
||||
var f2 = function (x, y) {
|
||||
return null;
|
||||
};
|
||||
var f2 = function (x, y) { return null; };
|
||||
var r2 = f2(1, '');
|
||||
var r2b = f2(1, '');
|
||||
var f3;
|
||||
|
||||
@@ -38,13 +38,9 @@ var r7 = i2.f(1);
|
||||
|
||||
//// [callGenericFunctionWithZeroTypeArguments.js]
|
||||
// valid invocations of generic functions with no explicit type arguments provided
|
||||
function f(x) {
|
||||
return null;
|
||||
}
|
||||
function f(x) { return null; }
|
||||
var r = f(1);
|
||||
var f2 = function (x) {
|
||||
return null;
|
||||
};
|
||||
var f2 = function (x) { return null; };
|
||||
var r2 = f2(1);
|
||||
var f3;
|
||||
var r3 = f3(1);
|
||||
|
||||
@@ -46,13 +46,9 @@ var r8 = a2<number>();
|
||||
//// [callNonGenericFunctionWithTypeArguments.js]
|
||||
// it is always illegal to provide type arguments to a non-generic function
|
||||
// all invocations here are illegal
|
||||
function f(x) {
|
||||
return null;
|
||||
}
|
||||
function f(x) { return null; }
|
||||
var r = f(1);
|
||||
var f2 = function (x) {
|
||||
return null;
|
||||
};
|
||||
var f2 = function (x) { return null; };
|
||||
var r2 = f2(1);
|
||||
var f3;
|
||||
var r3 = f3(1);
|
||||
|
||||
@@ -25,9 +25,7 @@ var Foo = (function () {
|
||||
Foo.prototype.bar1 = function () { };
|
||||
return Foo;
|
||||
})();
|
||||
function F1(a) {
|
||||
return a;
|
||||
}
|
||||
function F1(a) { return a; }
|
||||
var f1 = new Foo("hey");
|
||||
f1.bar1();
|
||||
Foo();
|
||||
|
||||
@@ -33,12 +33,8 @@ var Foo = (function () {
|
||||
Foo.prototype.bar1 = function () { };
|
||||
return Foo;
|
||||
})();
|
||||
function F1(s) {
|
||||
return s;
|
||||
} // error
|
||||
function F1(a) {
|
||||
return a;
|
||||
} // error
|
||||
function F1(s) { return s; } // error
|
||||
function F1(a) { return a; } // error
|
||||
var f1 = new Foo("hey");
|
||||
f1.bar1();
|
||||
Foo();
|
||||
|
||||
@@ -202,9 +202,7 @@ function foo12() {
|
||||
return i2;
|
||||
}
|
||||
var r12 = foo12();
|
||||
function m1() {
|
||||
return 1;
|
||||
}
|
||||
function m1() { return 1; }
|
||||
var m1;
|
||||
(function (m1) {
|
||||
m1.y = 2;
|
||||
|
||||
@@ -21,14 +21,8 @@ var r5b = _.map<number, string>(c2, rf1);
|
||||
//// [callbacksDontShareTypes.js]
|
||||
var _;
|
||||
var c2;
|
||||
var rf1 = function (x) {
|
||||
return x.toFixed();
|
||||
};
|
||||
var r1a = _.map(c2, function (x) {
|
||||
return x.toFixed();
|
||||
});
|
||||
var rf1 = function (x) { return x.toFixed(); };
|
||||
var r1a = _.map(c2, function (x) { return x.toFixed(); });
|
||||
var r1b = _.map(c2, rf1); // this line should not cause the following 2 to have errors
|
||||
var r5a = _.map(c2, function (x) {
|
||||
return x.toFixed();
|
||||
});
|
||||
var r5a = _.map(c2, function (x) { return x.toFixed(); });
|
||||
var r5b = _.map(c2, rf1);
|
||||
|
||||
@@ -47,7 +47,5 @@ var p_cast = ({
|
||||
add: function (dx, dy) {
|
||||
return new Point(this.x + dx, this.y + dy);
|
||||
},
|
||||
mult: function (p) {
|
||||
return p;
|
||||
}
|
||||
mult: function (p) { return p; }
|
||||
});
|
||||
|
||||
@@ -14,6 +14,4 @@ var s3 = s2.each(x => { x.key /* Type is K, should be number */ });
|
||||
//// [chainedSpecializationToObjectTypeLiteral.js]
|
||||
var s;
|
||||
var s2 = s.groupBy(function (s) { return s.length; });
|
||||
var s3 = s2.each(function (x) {
|
||||
x.key; /* Type is K, should be number */
|
||||
});
|
||||
var s3 = s2.each(function (x) { x.key; /* Type is K, should be number */ });
|
||||
|
||||
@@ -20,9 +20,7 @@ var C = (function () {
|
||||
return C;
|
||||
})();
|
||||
var y = {
|
||||
foo: ,
|
||||
class: C2
|
||||
}, _a = void 0;
|
||||
foo: , class: C2 }, _a = void 0;
|
||||
var M;
|
||||
(function (M) {
|
||||
var z = ;
|
||||
|
||||
@@ -19,20 +19,14 @@ var C = (function () {
|
||||
function C() {
|
||||
this.x = 1;
|
||||
}
|
||||
C.prototype.foo = function (x) {
|
||||
return x;
|
||||
};
|
||||
C.prototype.foo = function (x) { return x; };
|
||||
return C;
|
||||
})();
|
||||
var D2 = (function () {
|
||||
function D2() {
|
||||
this.x = 3;
|
||||
}
|
||||
D2.prototype.foo = function (x) {
|
||||
return x;
|
||||
};
|
||||
D2.prototype.other = function (x) {
|
||||
return x;
|
||||
};
|
||||
D2.prototype.foo = function (x) { return x; };
|
||||
D2.prototype.other = function (x) { return x; };
|
||||
return D2;
|
||||
})();
|
||||
|
||||
@@ -23,9 +23,7 @@ var __extends = this.__extends || function (d, b) {
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
A.prototype.foo = function () { return 1; };
|
||||
return A;
|
||||
})();
|
||||
var C = (function () {
|
||||
|
||||
@@ -24,9 +24,7 @@ var __extends = this.__extends || function (d, b) {
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
A.prototype.foo = function () { return 1; };
|
||||
return A;
|
||||
})();
|
||||
var C = (function () {
|
||||
|
||||
@@ -27,9 +27,7 @@ var A = (function () {
|
||||
function A() {
|
||||
this.x = 1;
|
||||
}
|
||||
A.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
A.prototype.foo = function () { return 1; };
|
||||
return A;
|
||||
})();
|
||||
var C = (function () {
|
||||
|
||||
@@ -28,9 +28,7 @@ var A = (function () {
|
||||
function A() {
|
||||
this.x = 1;
|
||||
}
|
||||
A.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
A.prototype.foo = function () { return 1; };
|
||||
return A;
|
||||
})();
|
||||
var C = (function () {
|
||||
|
||||
@@ -34,9 +34,7 @@ var A = (function () {
|
||||
A.bar = function () {
|
||||
return "";
|
||||
};
|
||||
A.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
A.prototype.foo = function () { return 1; };
|
||||
return A;
|
||||
})();
|
||||
var C = (function () {
|
||||
|
||||
@@ -31,9 +31,7 @@ var A = (function (_super) {
|
||||
function A() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
A.prototype.foo = function () {
|
||||
this.bar();
|
||||
};
|
||||
A.prototype.foo = function () { this.bar(); };
|
||||
return A;
|
||||
})(B);
|
||||
var B = (function () {
|
||||
|
||||
@@ -28,18 +28,14 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, "y", {
|
||||
get: function () {
|
||||
return null;
|
||||
},
|
||||
get: function () { return null; },
|
||||
set: function (x) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
C.prototype.foo = function () { };
|
||||
Object.defineProperty(C, "b", {
|
||||
get: function () {
|
||||
return null;
|
||||
},
|
||||
get: function () { return null; },
|
||||
set: function (x) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
||||
@@ -28,18 +28,14 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, "y", {
|
||||
get: function () {
|
||||
return null;
|
||||
},
|
||||
get: function () { return null; },
|
||||
set: function (x) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
C.prototype.foo = function () { };
|
||||
Object.defineProperty(C, "b", {
|
||||
get: function () {
|
||||
return null;
|
||||
},
|
||||
get: function () { return null; },
|
||||
set: function (x) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
||||
@@ -27,18 +27,14 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, "y", {
|
||||
get: function () {
|
||||
return null;
|
||||
},
|
||||
get: function () { return null; },
|
||||
set: function (x) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
C.prototype.foo = function () { };
|
||||
Object.defineProperty(C, "b", {
|
||||
get: function () {
|
||||
return null;
|
||||
},
|
||||
get: function () { return null; },
|
||||
set: function (x) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
||||
@@ -28,9 +28,7 @@ var A = (function () {
|
||||
A.bar = function () {
|
||||
return "";
|
||||
};
|
||||
A.prototype.foo = function () {
|
||||
return 1;
|
||||
};
|
||||
A.prototype.foo = function () { return 1; };
|
||||
return A;
|
||||
})();
|
||||
var C2 = (function (_super) {
|
||||
|
||||
@@ -30,13 +30,9 @@ i = c;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.y = function (a) {
|
||||
return null;
|
||||
};
|
||||
C.prototype.y = function (a) { return null; };
|
||||
Object.defineProperty(C.prototype, "z", {
|
||||
get: function () {
|
||||
return 1;
|
||||
},
|
||||
get: function () { return 1; },
|
||||
set: function (v) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
||||
@@ -32,13 +32,9 @@ i = c;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.y = function (a) {
|
||||
return null;
|
||||
};
|
||||
C.prototype.y = function (a) { return null; };
|
||||
Object.defineProperty(C.prototype, "z", {
|
||||
get: function () {
|
||||
return 1;
|
||||
},
|
||||
get: function () { return 1; },
|
||||
set: function (v) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
||||
@@ -30,12 +30,8 @@ var C = (function () {
|
||||
this.b = '';
|
||||
this.d = function () { return ''; };
|
||||
}
|
||||
C.prototype.c = function () {
|
||||
return '';
|
||||
};
|
||||
C.f = function () {
|
||||
return '';
|
||||
};
|
||||
C.prototype.c = function () { return ''; };
|
||||
C.f = function () { return ''; };
|
||||
C.g = function () { return ''; };
|
||||
return C;
|
||||
})();
|
||||
|
||||
@@ -41,12 +41,8 @@ var C = (function () {
|
||||
this.b = '';
|
||||
this.d = function () { return ''; };
|
||||
}
|
||||
C.prototype.c = function () {
|
||||
return '';
|
||||
};
|
||||
C.f = function () {
|
||||
return '';
|
||||
};
|
||||
C.prototype.c = function () { return ''; };
|
||||
C.f = function () { return ''; };
|
||||
C.g = function () { return ''; };
|
||||
return C;
|
||||
})();
|
||||
|
||||
@@ -28,12 +28,8 @@ var C = (function () {
|
||||
this.b = '';
|
||||
this.d = function () { return ''; };
|
||||
}
|
||||
C.prototype.c = function () {
|
||||
return '';
|
||||
};
|
||||
C.f = function () {
|
||||
return '';
|
||||
};
|
||||
C.prototype.c = function () { return ''; };
|
||||
C.f = function () { return ''; };
|
||||
C.g = function () { return ''; };
|
||||
return C;
|
||||
})();
|
||||
|
||||
@@ -31,13 +31,9 @@ var C = (function () {
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
}
|
||||
C.fn = function () {
|
||||
return this;
|
||||
};
|
||||
C.fn = function () { return this; };
|
||||
Object.defineProperty(C, "x", {
|
||||
get: function () {
|
||||
return 1;
|
||||
},
|
||||
get: function () { return 1; },
|
||||
set: function (v) { },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
||||
@@ -20,9 +20,7 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, "x", {
|
||||
get: function () {
|
||||
return 1;
|
||||
},
|
||||
get: function () { return 1; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -38,9 +38,7 @@ var Shape;
|
||||
(function (Shape) {
|
||||
var Utils;
|
||||
(function (Utils) {
|
||||
function convert() {
|
||||
return null;
|
||||
}
|
||||
function convert() { return null; }
|
||||
Utils.convert = convert;
|
||||
})(Utils = Shape.Utils || (Shape.Utils = {}));
|
||||
})(Shape || (Shape = {}));
|
||||
|
||||
@@ -12,7 +12,5 @@ var console;
|
||||
function x() {
|
||||
var _this = this;
|
||||
var _this = 5;
|
||||
(function (x) {
|
||||
console.log(_this.x);
|
||||
});
|
||||
(function (x) { console.log(_this.x); });
|
||||
}
|
||||
|
||||
@@ -144,9 +144,7 @@ var Foo1 = (function () {
|
||||
})();
|
||||
function f1(_this) {
|
||||
var _this = this;
|
||||
(function (x) {
|
||||
console.log(_this.x);
|
||||
});
|
||||
(function (x) { console.log(_this.x); });
|
||||
}
|
||||
var Foo3 = (function () {
|
||||
function Foo3(_this) {
|
||||
@@ -167,7 +165,5 @@ var Foo3 = (function () {
|
||||
})();
|
||||
function f3(_this) {
|
||||
var _this = this;
|
||||
(function (x) {
|
||||
console.log(_this.x);
|
||||
});
|
||||
(function (x) { console.log(_this.x); });
|
||||
}
|
||||
|
||||
@@ -14,9 +14,7 @@ var C = (function () {
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
get: function () {
|
||||
return 1;
|
||||
},
|
||||
get: function () { return 1; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -19,9 +19,7 @@ var C = (function () {
|
||||
/**
|
||||
* Getter.
|
||||
*/
|
||||
get: function () {
|
||||
return 1;
|
||||
},
|
||||
get: function () { return 1; },
|
||||
/**
|
||||
* Setter.
|
||||
*/
|
||||
|
||||
@@ -11,4 +11,7 @@ Foo(() =>
|
||||
//// [commentOnSimpleArrowFunctionBody1.js]
|
||||
function Foo(x) {
|
||||
}
|
||||
Foo(function () { return 127; });
|
||||
Foo(function () {
|
||||
// do something
|
||||
return 127;
|
||||
});
|
||||
|
||||
@@ -68,9 +68,7 @@ var Derived = (function (_super) {
|
||||
})(Base);
|
||||
var BaseCollection = (function () {
|
||||
function BaseCollection(f) {
|
||||
(function (item) {
|
||||
return [item.Components];
|
||||
});
|
||||
(function (item) { return [item.Components]; });
|
||||
}
|
||||
return BaseCollection;
|
||||
})();
|
||||
@@ -83,9 +81,7 @@ var Thing = (function () {
|
||||
function Thing() {
|
||||
}
|
||||
Object.defineProperty(Thing.prototype, "Components", {
|
||||
get: function () {
|
||||
return null;
|
||||
},
|
||||
get: function () { return null; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -7,12 +7,8 @@ var z: number = h<number>(f);
|
||||
var z: number = h(f);
|
||||
|
||||
//// [compositeGenericFunction.js]
|
||||
function f(value) {
|
||||
return value;
|
||||
}
|
||||
function f(value) { return value; }
|
||||
;
|
||||
function h(func) {
|
||||
return null;
|
||||
}
|
||||
function h(func) { return null; }
|
||||
var z = h(f);
|
||||
var z = h(f);
|
||||
|
||||
@@ -20,18 +20,6 @@ var v = {
|
||||
var s;
|
||||
var n;
|
||||
var a;
|
||||
var v = (_a = {}, _a[s] = Object.defineProperty({ get: function () {
|
||||
return 0;
|
||||
}, enumerable: true, configurable: true }), _a[n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[s + s] = Object.defineProperty({ get: function () {
|
||||
return 0;
|
||||
}, enumerable: true, configurable: true }), _a[s + n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[+s] = Object.defineProperty({ get: function () {
|
||||
return 0;
|
||||
}, enumerable: true, configurable: true }), _a[""] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[0] = Object.defineProperty({ get: function () {
|
||||
return 0;
|
||||
}, enumerable: true, configurable: true }), _a[a] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[true] = Object.defineProperty({ get: function () {
|
||||
return 0;
|
||||
}, enumerable: true, configurable: true }), _a["hello bye"] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a["hello " + a + " bye"] = Object.defineProperty({ get: function () {
|
||||
return 0;
|
||||
}, enumerable: true, configurable: true }),
|
||||
var v = (_a = {}, _a[s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[s + s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[s + n] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[+s] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[""] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[0] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[a] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a[true] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a["hello bye"] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }), _a["hello " + a + " bye"] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }),
|
||||
_a);
|
||||
var _a;
|
||||
|
||||
@@ -21,27 +21,15 @@ var s;
|
||||
var n;
|
||||
var a;
|
||||
var v = {
|
||||
get [s]() {
|
||||
return 0;
|
||||
},
|
||||
get [s]() { return 0; },
|
||||
set [n](v) { },
|
||||
get [s + s]() {
|
||||
return 0;
|
||||
},
|
||||
get [s + s]() { return 0; },
|
||||
set [s + n](v) { },
|
||||
get [+s]() {
|
||||
return 0;
|
||||
},
|
||||
get [+s]() { return 0; },
|
||||
set [""](v) { },
|
||||
get [0]() {
|
||||
return 0;
|
||||
},
|
||||
get [0]() { return 0; },
|
||||
set [a](v) { },
|
||||
get [true]() {
|
||||
return 0;
|
||||
},
|
||||
get [true]() { return 0; },
|
||||
set [`hello bye`](v) { },
|
||||
get [`hello ${a} bye`]() {
|
||||
return 0;
|
||||
}
|
||||
get [`hello ${a} bye`]() { return 0; }
|
||||
};
|
||||
|
||||
@@ -24,9 +24,7 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, s, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -36,9 +34,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, s + s, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -48,9 +44,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, +s, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -60,9 +54,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, 0, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -72,9 +64,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, true, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -84,9 +74,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, "hello " + a + " bye", {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -24,9 +24,7 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, s, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -36,9 +34,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, s + s, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -48,9 +44,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, +s, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -60,9 +54,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, 0, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -72,9 +64,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, true, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -84,9 +74,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, `hello ${a} bye`, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -15,9 +15,7 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, b, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -27,9 +25,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, [], {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -39,9 +35,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, undefined, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -15,9 +15,7 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
Object.defineProperty(C.prototype, b, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -27,9 +25,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C.prototype, [], {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
@@ -39,9 +35,7 @@ var C = (function () {
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(C, undefined, {
|
||||
get: function () {
|
||||
return 0;
|
||||
},
|
||||
get: function () { return 0; },
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
@@ -5,8 +5,6 @@ var v = {
|
||||
}
|
||||
|
||||
//// [computedPropertyNames1_ES5.js]
|
||||
var v = (_a = {}, _a[0 + 1] = Object.defineProperty({ get: function () {
|
||||
return 0;
|
||||
}, enumerable: true, configurable: true }), _a[0 + 1] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
|
||||
var v = (_a = {}, _a[0 + 1] = Object.defineProperty({ get: function () { return 0; }, enumerable: true, configurable: true }), _a[0 + 1] = Object.defineProperty({ set: function (v) { }, enumerable: true, configurable: true }),
|
||||
_a);
|
||||
var _a;
|
||||
|
||||
@@ -6,8 +6,6 @@ var v = {
|
||||
|
||||
//// [computedPropertyNames1_ES6.js]
|
||||
var v = {
|
||||
get [0 + 1]() {
|
||||
return 0;
|
||||
},
|
||||
get [0 + 1]() { return 0; },
|
||||
set [0 + 1](v) { } //No error
|
||||
};
|
||||
|
||||
@@ -8,9 +8,7 @@ class C<T> {
|
||||
}
|
||||
|
||||
//// [computedPropertyNames32_ES5.js]
|
||||
function foo() {
|
||||
return '';
|
||||
}
|
||||
function foo() { return ''; }
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@ class C<T> {
|
||||
}
|
||||
|
||||
//// [computedPropertyNames32_ES6.js]
|
||||
function foo() {
|
||||
return '';
|
||||
}
|
||||
function foo() { return ''; }
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
|
||||
@@ -10,9 +10,7 @@ class C<T> {
|
||||
}
|
||||
|
||||
//// [computedPropertyNames33_ES5.js]
|
||||
function foo() {
|
||||
return '';
|
||||
}
|
||||
function foo() { return ''; }
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user