Merge pull request #14274 from Microsoft/master-14217

[Master] Fix 14217 emit shebang at the top of output file
This commit is contained in:
Yui
2017-03-29 09:08:17 -07:00
committed by GitHub
4846 changed files with 27338 additions and 31870 deletions
+70 -27
View File
@@ -276,6 +276,8 @@ namespace ts {
function writeBundle(bundle: Bundle, output: EmitTextWriter) {
const previousWriter = writer;
setWriter(output);
emitShebangIfNeeded(bundle);
emitPrologueDirectivesIfNeeded(bundle);
emitHelpersIndirect(bundle);
for (const sourceFile of bundle.sourceFiles) {
print(EmitHint.SourceFile, sourceFile, sourceFile);
@@ -287,6 +289,8 @@ namespace ts {
function writeFile(sourceFile: SourceFile, output: EmitTextWriter) {
const previousWriter = writer;
setWriter(output);
emitShebangIfNeeded(sourceFile);
emitPrologueDirectivesIfNeeded(sourceFile);
print(EmitHint.SourceFile, sourceFile, sourceFile);
reset();
writer = previousWriter;
@@ -737,15 +741,6 @@ namespace ts {
return node && substituteNode && substituteNode(hint, node) || node;
}
function emitBodyIndirect(node: Node, elements: NodeArray<Node>, emitCallback: (node: Node) => void): void {
if (emitBodyWithDetachedComments) {
emitBodyWithDetachedComments(node, elements, emitCallback);
}
else {
emitCallback(node);
}
}
function emitHelpersIndirect(node: Node) {
if (onEmitHelpers) {
onEmitHelpers(node, writeLines);
@@ -1663,7 +1658,12 @@ namespace ts {
? emitBlockFunctionBodyOnSingleLine
: emitBlockFunctionBodyWorker;
emitBodyIndirect(body, body.statements, emitBlockFunctionBody);
if (emitBodyWithDetachedComments) {
emitBodyWithDetachedComments(body, body.statements, emitBlockFunctionBody);
}
else {
emitBlockFunctionBody(body);
}
decreaseIndent();
writeToken(SyntaxKind.CloseBraceToken, body.statements.end, body);
@@ -2072,16 +2072,27 @@ namespace ts {
function emitSourceFile(node: SourceFile) {
writeLine();
emitShebang();
emitBodyIndirect(node, node.statements, emitSourceFileWorker);
const statements = node.statements;
if (emitBodyWithDetachedComments) {
// Emit detached comment if there are no prologue directives or if the first node is synthesized.
// The synthesized node will have no leading comment so some comments may be missed.
const shouldEmitDetachedComment = statements.length === 0 ||
!isPrologueDirective(statements[0]) ||
nodeIsSynthesized(statements[0]);
if (shouldEmitDetachedComment) {
emitBodyWithDetachedComments(node, statements, emitSourceFileWorker);
return;
}
}
emitSourceFileWorker(node);
}
function emitSourceFileWorker(node: SourceFile) {
const statements = node.statements;
const statementOffset = emitPrologueDirectives(statements);
pushNameGenerationScope();
emitHelpersIndirect(node);
emitList(node, statements, ListFormat.MultiLine, statementOffset);
const index = findIndex(statements, statement => !isPrologueDirective(statement));
emitList(node, statements, ListFormat.MultiLine, index === -1 ? statements.length : index);
popNameGenerationScope();
}
@@ -2095,13 +2106,20 @@ namespace ts {
* Emits any prologue directives at the start of a Statement list, returning the
* number of prologue directives written to the output.
*/
function emitPrologueDirectives(statements: Node[], startWithNewLine?: boolean): number {
function emitPrologueDirectives(statements: Node[], startWithNewLine?: boolean, seenPrologueDirectives?: Map<String>): number {
for (let i = 0; i < statements.length; i++) {
if (isPrologueDirective(statements[i])) {
if (startWithNewLine || i > 0) {
writeLine();
const statement = statements[i];
if (isPrologueDirective(statement)) {
const shouldEmitPrologueDirective = seenPrologueDirectives ? !seenPrologueDirectives.has(statement.expression.text) : true;
if (shouldEmitPrologueDirective) {
if (startWithNewLine || i > 0) {
writeLine();
}
emit(statement);
if (seenPrologueDirectives) {
seenPrologueDirectives.set(statement.expression.text, statement.expression.text);
}
}
emit(statements[i]);
}
else {
// return index of the first non prologue directive
@@ -2112,18 +2130,43 @@ namespace ts {
return statements.length;
}
function emitPrologueDirectivesIfNeeded(sourceFileOrBundle: Bundle | SourceFile) {
if (isSourceFile(sourceFileOrBundle)) {
setSourceFile(sourceFileOrBundle as SourceFile);
emitPrologueDirectives((sourceFileOrBundle as SourceFile).statements);
}
else {
const seenPrologueDirectives = createMap<String>();
for (const sourceFile of (sourceFileOrBundle as Bundle).sourceFiles) {
setSourceFile(sourceFile);
emitPrologueDirectives(sourceFile.statements, /*startWithNewLine*/ true, seenPrologueDirectives);
}
}
}
function emitShebangIfNeeded(sourceFileOrBundle: Bundle | SourceFile) {
if (isSourceFile(sourceFileOrBundle)) {
const shebang = getShebang(sourceFileOrBundle.text);
if (shebang) {
write(shebang);
writeLine();
return true;
}
}
else {
for (const sourceFile of sourceFileOrBundle.sourceFiles) {
// Emit only the first encountered shebang
if (emitShebangIfNeeded(sourceFile)) {
break;
}
}
}
}
//
// Helpers
//
function emitShebang() {
const shebang = getShebang(currentSourceFile.text);
if (shebang) {
write(shebang);
writeLine();
}
}
function emitModifiers(node: Node, modifiers: NodeArray<Modifier>) {
if (modifiers && modifiers.length) {
emitList(node, modifiers, ListFormat.Modifiers);
+1 -1
View File
@@ -1797,7 +1797,7 @@ namespace Harness {
if (currentFileContent === undefined) {
currentFileContent = "";
}
else {
else if (currentFileContent !== "") {
// End-of-line
currentFileContent = currentFileContent + "\n";
}
@@ -1,5 +1,4 @@
//// [APISample_compile.ts]
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler
@@ -35,12 +34,12 @@ compile(process.argv.slice(2), {
});
//// [APISample_compile.js]
"use strict";
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler
* Please log a "breaking change" issue for any API breaking change affecting this issue
*/
"use strict";
exports.__esModule = true;
var ts = require("typescript");
function compile(fileNames, options) {
@@ -1,5 +1,4 @@
//// [APISample_linter.ts]
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter
@@ -65,12 +64,12 @@ fileNames.forEach(fileName => {
});
//// [APISample_linter.js]
"use strict";
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter
* Please log a "breaking change" issue for any API breaking change affecting this issue
*/
"use strict";
exports.__esModule = true;
var ts = require("typescript");
function delint(sourceFile) {
@@ -1,5 +1,4 @@
//// [APISample_parseConfig.ts]
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler
@@ -37,12 +36,12 @@ export function createProgram(rootFiles: string[], compilerOptionsJson: string):
}
//// [APISample_parseConfig.js]
"use strict";
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler
* Please log a "breaking change" issue for any API breaking change affecting this issue
*/
"use strict";
exports.__esModule = true;
var ts = require("typescript");
function printError(error) {
@@ -1,5 +1,4 @@
//// [APISample_transform.ts]
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function
@@ -17,12 +16,12 @@ let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS });
console.log(JSON.stringify(result));
//// [APISample_transform.js]
"use strict";
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function
* Please log a "breaking change" issue for any API breaking change affecting this issue
*/
"use strict";
exports.__esModule = true;
var ts = require("typescript");
var source = "let x: string = 'string'";
@@ -1,5 +1,4 @@
//// [APISample_watcher.ts]
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services
@@ -110,12 +109,12 @@ const currentDirectoryFiles = fs.readdirSync(process.cwd()).
watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS });
//// [APISample_watcher.js]
"use strict";
/*
* Note: This test is a public API sample. The sample sources can be found
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services
* Please log a "breaking change" issue for any API breaking change affecting this issue
*/
"use strict";
exports.__esModule = true;
var ts = require("typescript");
function watch(rootFileNames, options) {
@@ -1,8 +1,7 @@
tests/cases/compiler/DeclarationErrorsNoEmitOnError.ts(4,8): error TS4033: Property 'f' of exported interface has or is using private name 'T'.
tests/cases/compiler/DeclarationErrorsNoEmitOnError.ts(3,8): error TS4033: Property 'f' of exported interface has or is using private name 'T'.
==== tests/cases/compiler/DeclarationErrorsNoEmitOnError.ts (1 errors) ====
type T = { x : number }
export interface I {
f: T;
@@ -1,9 +1,8 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(10,6): error TS2304: Cannot find name 'Symbol'.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(15,15): error TS2495: Type 'StringIterator' is not an array type or a string type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(9,6): error TS2304: Cannot find name 'Symbol'.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(14,15): error TS2495: Type 'StringIterator' is not an array type or a string type.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts (2 errors) ====
// In ES3/5, you cannot for...of over an arbitrary iterable.
class StringIterator {
next() {
@@ -1,5 +1,4 @@
//// [ES5For-ofTypeCheck10.ts]
// In ES3/5, you cannot for...of over an arbitrary iterable.
class StringIterator {
next() {
-1
View File
@@ -1,5 +1,4 @@
//// [ES5for-of32.ts]
var array = [1,2,3];
var sum = 0;
@@ -1,23 +1,22 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5for-of32.ts ===
var array = [1,2,3];
>array : Symbol(array, Decl(ES5for-of32.ts, 1, 3))
>array : Symbol(array, Decl(ES5for-of32.ts, 0, 3))
var sum = 0;
>sum : Symbol(sum, Decl(ES5for-of32.ts, 2, 3))
>sum : Symbol(sum, Decl(ES5for-of32.ts, 1, 3))
for (let num of array) {
>num : Symbol(num, Decl(ES5for-of32.ts, 4, 8))
>array : Symbol(array, Decl(ES5for-of32.ts, 1, 3))
>num : Symbol(num, Decl(ES5for-of32.ts, 3, 8))
>array : Symbol(array, Decl(ES5for-of32.ts, 0, 3))
if (sum === 0) {
>sum : Symbol(sum, Decl(ES5for-of32.ts, 2, 3))
>sum : Symbol(sum, Decl(ES5for-of32.ts, 1, 3))
array = [4,5,6]
>array : Symbol(array, Decl(ES5for-of32.ts, 1, 3))
>array : Symbol(array, Decl(ES5for-of32.ts, 0, 3))
}
sum += num;
>sum : Symbol(sum, Decl(ES5for-of32.ts, 2, 3))
>num : Symbol(num, Decl(ES5for-of32.ts, 4, 8))
>sum : Symbol(sum, Decl(ES5for-of32.ts, 1, 3))
>num : Symbol(num, Decl(ES5for-of32.ts, 3, 8))
}
@@ -1,5 +1,4 @@
=== tests/cases/conformance/statements/for-ofStatements/ES5for-of32.ts ===
var array = [1,2,3];
>array : number[]
>[1,2,3] : number[]
@@ -1,10 +1,9 @@
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(3,8): error TS1123: Variable declaration list cannot be empty.
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(4,5): error TS2304: Cannot find name 'let'.
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(5,10): error TS1123: Variable declaration list cannot be empty.
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(2,8): error TS1123: Variable declaration list cannot be empty.
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(3,5): error TS2304: Cannot find name 'let'.
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(4,10): error TS1123: Variable declaration list cannot be empty.
==== tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts (3 errors) ====
module Inner {
var;
@@ -1,5 +1,4 @@
//// [NonInitializedExportInInternalModule.ts]
module Inner {
var;
let;
@@ -1,5 +1,4 @@
//// [VariableDeclaration12_es6.ts]
let
x
@@ -1,6 +1,5 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration12_es6.ts ===
let
x
>x : Symbol(x, Decl(VariableDeclaration12_es6.ts, 1, 3))
>x : Symbol(x, Decl(VariableDeclaration12_es6.ts, 0, 3))
@@ -1,5 +1,4 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration12_es6.ts ===
let
x
>x : any
@@ -1,11 +1,10 @@
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(5,5): error TS1181: Array element destructuring pattern expected.
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(5,6): error TS1005: ',' expected.
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(5,8): error TS1134: Variable declaration expected.
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(5,10): error TS1134: Variable declaration expected.
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(4,5): error TS1181: Array element destructuring pattern expected.
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(4,6): error TS1005: ',' expected.
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(4,8): error TS1134: Variable declaration expected.
tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts(4,10): error TS1134: Variable declaration expected.
==== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration13_es6.ts (4 errors) ====
// An ExpressionStatement cannot start with the two token sequence `let [` because
// that would make it ambiguous with a `let` LexicalDeclaration whose first LexicalBinding was an ArrayBindingPattern.
var let: any;
@@ -1,5 +1,4 @@
//// [VariableDeclaration13_es6.ts]
// An ExpressionStatement cannot start with the two token sequence `let [` because
// that would make it ambiguous with a `let` LexicalDeclaration whose first LexicalBinding was an ArrayBindingPattern.
var let: any;
@@ -1,5 +1,4 @@
//// [abstractInterfaceIdentifierName.ts]
interface abstract {
abstract(): void;
}
@@ -1,9 +1,8 @@
=== tests/cases/compiler/abstractInterfaceIdentifierName.ts ===
interface abstract {
>abstract : Symbol(abstract, Decl(abstractInterfaceIdentifierName.ts, 0, 0))
abstract(): void;
>abstract : Symbol(abstract.abstract, Decl(abstractInterfaceIdentifierName.ts, 1, 20))
>abstract : Symbol(abstract.abstract, Decl(abstractInterfaceIdentifierName.ts, 0, 20))
}
@@ -1,5 +1,4 @@
=== tests/cases/compiler/abstractInterfaceIdentifierName.ts ===
interface abstract {
>abstract : abstract
@@ -1,23 +1,22 @@
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(21,12): error TS1029: 'private' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(22,12): error TS1029: 'private' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(23,12): error TS1029: 'private' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(24,12): error TS1029: 'private' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(25,12): error TS1029: 'private' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(26,12): error TS1029: 'protected' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(27,12): error TS1029: 'protected' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(28,12): error TS1029: 'protected' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(29,12): error TS1029: 'protected' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(30,12): error TS1029: 'protected' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(31,12): error TS1029: 'public' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(32,12): error TS1029: 'public' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(33,12): error TS1029: 'public' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(34,12): error TS1029: 'public' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(35,12): error TS1029: 'public' modifier must precede 'static' modifier.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(40,13): error TS1028: Accessibility modifier already seen.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(41,12): error TS1028: Accessibility modifier already seen.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(42,13): error TS1028: Accessibility modifier already seen.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(43,12): error TS1028: Accessibility modifier already seen.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(39,13): error TS1028: Accessibility modifier already seen.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(40,12): error TS1028: Accessibility modifier already seen.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(41,13): error TS1028: Accessibility modifier already seen.
tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts(42,12): error TS1028: Accessibility modifier already seen.
==== tests/cases/conformance/classes/propertyMemberDeclarations/accessibilityModifiers.ts (16 errors) ====
// No errors
class C {
private static privateProperty;
@@ -1,5 +1,4 @@
//// [accessibilityModifiers.ts]
// No errors
class C {
private static privateProperty;
@@ -1,9 +1,8 @@
tests/cases/compiler/accessorParameterAccessibilityModifier.ts(3,11): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/compiler/accessorParameterAccessibilityModifier.ts(4,18): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/compiler/accessorParameterAccessibilityModifier.ts(2,11): error TS2369: A parameter property is only allowed in a constructor implementation.
tests/cases/compiler/accessorParameterAccessibilityModifier.ts(3,18): error TS2369: A parameter property is only allowed in a constructor implementation.
==== tests/cases/compiler/accessorParameterAccessibilityModifier.ts (2 errors) ====
class C {
set X(public v) { }
~~~~~~~~
@@ -1,5 +1,4 @@
//// [accessorParameterAccessibilityModifier.ts]
class C {
set X(public v) { }
static set X(public v2) { }
@@ -1,11 +1,10 @@
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(5,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(16,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(20,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(4,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(10,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts(19,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES3.ts (4 errors) ====
// error to use accessors in ES3 mode
class C {
@@ -1,5 +1,4 @@
//// [accessorWithES3.ts]
// error to use accessors in ES3 mode
class C {
@@ -1,5 +1,4 @@
//// [accessorWithES5.ts]
class C {
get x() {
return 1;
@@ -1,35 +1,34 @@
=== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES5.ts ===
class C {
>C : Symbol(C, Decl(accessorWithES5.ts, 0, 0))
get x() {
>x : Symbol(C.x, Decl(accessorWithES5.ts, 1, 9))
>x : Symbol(C.x, Decl(accessorWithES5.ts, 0, 9))
return 1;
}
}
class D {
>D : Symbol(D, Decl(accessorWithES5.ts, 5, 1))
>D : Symbol(D, Decl(accessorWithES5.ts, 4, 1))
set x(v) {
>x : Symbol(D.x, Decl(accessorWithES5.ts, 7, 9))
>v : Symbol(v, Decl(accessorWithES5.ts, 8, 10))
>x : Symbol(D.x, Decl(accessorWithES5.ts, 6, 9))
>v : Symbol(v, Decl(accessorWithES5.ts, 7, 10))
}
}
var x = {
>x : Symbol(x, Decl(accessorWithES5.ts, 12, 3))
>x : Symbol(x, Decl(accessorWithES5.ts, 11, 3))
get a() { return 1 }
>a : Symbol(a, Decl(accessorWithES5.ts, 12, 9))
>a : Symbol(a, Decl(accessorWithES5.ts, 11, 9))
}
var y = {
>y : Symbol(y, Decl(accessorWithES5.ts, 16, 3))
>y : Symbol(y, Decl(accessorWithES5.ts, 15, 3))
set b(v) { }
>b : Symbol(b, Decl(accessorWithES5.ts, 16, 9))
>v : Symbol(v, Decl(accessorWithES5.ts, 17, 10))
>b : Symbol(b, Decl(accessorWithES5.ts, 15, 9))
>v : Symbol(v, Decl(accessorWithES5.ts, 16, 10))
}
@@ -1,5 +1,4 @@
=== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithES5.ts ===
class C {
>C : C
@@ -1,9 +1,8 @@
tests/cases/compiler/accessorWithInitializer.ts(3,9): error TS1052: A 'set' accessor parameter cannot have an initializer.
tests/cases/compiler/accessorWithInitializer.ts(4,16): error TS1052: A 'set' accessor parameter cannot have an initializer.
tests/cases/compiler/accessorWithInitializer.ts(2,9): error TS1052: A 'set' accessor parameter cannot have an initializer.
tests/cases/compiler/accessorWithInitializer.ts(3,16): error TS1052: A 'set' accessor parameter cannot have an initializer.
==== tests/cases/compiler/accessorWithInitializer.ts (2 errors) ====
class C {
set X(v = 0) { }
~
@@ -1,5 +1,4 @@
//// [accessorWithInitializer.ts]
class C {
set X(v = 0) { }
static set X(v2 = 0) { }
@@ -1,15 +1,14 @@
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(3,9): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(6,17): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(11,19): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(14,17): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(19,19): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(21,9): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(27,26): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(29,16): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(2,9): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(5,17): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(10,19): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(13,17): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(18,19): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(20,9): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(26,26): error TS2379: Getter and setter accessors do not agree in visibility.
tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts(28,16): error TS2379: Getter and setter accessors do not agree in visibility.
==== tests/cases/conformance/classes/propertyMemberDeclarations/memberAccessorDeclarations/accessorWithMismatchedAccessibilityModifiers.ts (8 errors) ====
class C {
get x() {
~
@@ -1,5 +1,4 @@
//// [accessorWithMismatchedAccessibilityModifiers.ts]
class C {
get x() {
return 1;
@@ -1,9 +1,8 @@
tests/cases/compiler/accessorWithRestParam.ts(3,11): error TS1053: A 'set' accessor cannot have rest parameter.
tests/cases/compiler/accessorWithRestParam.ts(4,18): error TS1053: A 'set' accessor cannot have rest parameter.
tests/cases/compiler/accessorWithRestParam.ts(2,11): error TS1053: A 'set' accessor cannot have rest parameter.
tests/cases/compiler/accessorWithRestParam.ts(3,18): error TS1053: A 'set' accessor cannot have rest parameter.
==== tests/cases/compiler/accessorWithRestParam.ts (2 errors) ====
class C {
set X(...v) { }
~~~
@@ -1,5 +1,4 @@
//// [accessorWithRestParam.ts]
class C {
set X(...v) { }
static set X(...v2) { }
@@ -1,15 +1,14 @@
tests/cases/compiler/accessorsInAmbientContext.ts(3,13): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(4,13): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(5,13): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(6,20): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(7,20): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(8,20): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(12,9): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(15,16): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(16,16): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/accessorsInAmbientContext.ts(17,16): error TS1086: An accessor cannot be declared in an ambient context.
==== tests/cases/compiler/accessorsInAmbientContext.ts (8 errors) ====
declare module M {
class C {
get X() { return 1; }
@@ -1,5 +1,4 @@
//// [accessorsInAmbientContext.ts]
declare module M {
class C {
get X() { return 1; }
@@ -1,9 +1,8 @@
tests/cases/compiler/accessorsNotAllowedInES3.ts(3,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/accessorsNotAllowedInES3.ts(5,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/accessorsNotAllowedInES3.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/accessorsNotAllowedInES3.ts(4,15): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
==== tests/cases/compiler/accessorsNotAllowedInES3.ts (2 errors) ====
class C {
get x(): number { return 1; }
~
@@ -1,5 +1,4 @@
//// [accessorsNotAllowedInES3.ts]
class C {
get x(): number { return 1; }
}
@@ -1,8 +1,7 @@
tests/cases/compiler/aliasBug.ts(17,15): error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'.
tests/cases/compiler/aliasBug.ts(16,15): error TS2694: Namespace 'foo.bar.baz' has no exported member 'bar'.
==== tests/cases/compiler/aliasBug.ts (1 errors) ====
module foo {
export class Provide {
}
-1
View File
@@ -1,5 +1,4 @@
//// [aliasBug.ts]
module foo {
export class Provide {
}
@@ -1,8 +1,7 @@
tests/cases/compiler/aliasesInSystemModule1.ts(2,24): error TS2307: Cannot find module 'foo'.
tests/cases/compiler/aliasesInSystemModule1.ts(1,24): error TS2307: Cannot find module 'foo'.
==== tests/cases/compiler/aliasesInSystemModule1.ts (1 errors) ====
import alias = require('foo');
~~~~~
!!! error TS2307: Cannot find module 'foo'.
@@ -1,5 +1,4 @@
//// [aliasesInSystemModule1.ts]
import alias = require('foo');
import cls = alias.Class;
export import cls2 = alias.Class;
@@ -1,8 +1,7 @@
tests/cases/compiler/aliasesInSystemModule2.ts(2,21): error TS2307: Cannot find module 'foo'.
tests/cases/compiler/aliasesInSystemModule2.ts(1,21): error TS2307: Cannot find module 'foo'.
==== tests/cases/compiler/aliasesInSystemModule2.ts (1 errors) ====
import {alias} from "foo";
~~~~~
!!! error TS2307: Cannot find module 'foo'.
@@ -1,5 +1,4 @@
//// [aliasesInSystemModule2.ts]
import {alias} from "foo";
import cls = alias.Class;
export import cls2 = alias.Class;
@@ -1,8 +1,7 @@
tests/cases/compiler/alwaysStrict.ts(3,9): error TS1100: Invalid use of 'arguments' in strict mode.
tests/cases/compiler/alwaysStrict.ts(2,9): error TS1100: Invalid use of 'arguments' in strict mode.
==== tests/cases/compiler/alwaysStrict.ts (1 errors) ====
function f() {
var arguments = [];
~~~~~~~~~
@@ -1,5 +1,4 @@
//// [alwaysStrict.ts]
function f() {
var arguments = [];
}
@@ -1,8 +1,7 @@
tests/cases/compiler/alwaysStrictES6.ts(3,9): error TS1100: Invalid use of 'arguments' in strict mode.
tests/cases/compiler/alwaysStrictES6.ts(2,9): error TS1100: Invalid use of 'arguments' in strict mode.
==== tests/cases/compiler/alwaysStrictES6.ts (1 errors) ====
function f() {
var arguments = [];
~~~~~~~~~
@@ -1,5 +1,4 @@
//// [alwaysStrictES6.ts]
function f() {
var arguments = [];
}
@@ -1,8 +1,7 @@
tests/cases/compiler/alwaysStrictModule.ts(4,13): error TS1100: Invalid use of 'arguments' in strict mode.
tests/cases/compiler/alwaysStrictModule.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode.
==== tests/cases/compiler/alwaysStrictModule.ts (1 errors) ====
module M {
export function f() {
var arguments = [];
@@ -1,5 +1,4 @@
//// [alwaysStrictModule.ts]
module M {
export function f() {
var arguments = [];
@@ -1,9 +1,8 @@
tests/cases/compiler/a.ts(4,13): error TS1100: Invalid use of 'arguments' in strict mode.
tests/cases/compiler/a.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode.
tests/cases/compiler/b.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode.
==== tests/cases/compiler/a.ts (1 errors) ====
module M {
export function f() {
var arguments = [];
@@ -1,7 +1,6 @@
//// [tests/cases/compiler/alwaysStrictModule2.ts] ////
//// [a.ts]
module M {
export function f() {
var arguments = [];
@@ -24,7 +23,6 @@ var M;
}
M.f = f;
})(M || (M = {}));
"use strict";
var M;
(function (M) {
function f2() {
@@ -1,8 +1,8 @@
//// [alwaysStrictModule3.ts]
// module ES2015
export const a = 1;
//// [alwaysStrictModule3.js]
// module ES2015
// module ES2015
export var a = 1;
@@ -1,6 +1,5 @@
=== tests/cases/compiler/alwaysStrictModule3.ts ===
// module ES2015
export const a = 1;
>a : Symbol(a, Decl(alwaysStrictModule3.ts, 2, 12))
>a : Symbol(a, Decl(alwaysStrictModule3.ts, 1, 12))
@@ -1,5 +1,4 @@
=== tests/cases/compiler/alwaysStrictModule3.ts ===
// module ES2015
export const a = 1;
>a : 1
@@ -1,5 +1,4 @@
//// [alwaysStrictModule4.ts]
// Module commonjs
export const a = 1
@@ -1,6 +1,5 @@
=== tests/cases/compiler/alwaysStrictModule4.ts ===
// Module commonjs
export const a = 1
>a : Symbol(a, Decl(alwaysStrictModule4.ts, 2, 12))
>a : Symbol(a, Decl(alwaysStrictModule4.ts, 1, 12))
@@ -1,5 +1,4 @@
=== tests/cases/compiler/alwaysStrictModule4.ts ===
// Module commonjs
export const a = 1
>a : 1
@@ -1,8 +1,8 @@
//// [alwaysStrictModule5.ts]
// Targeting ES6
export const a = 1;
//// [alwaysStrictModule5.js]
// Targeting ES6
// Targeting ES6
export const a = 1;
@@ -1,6 +1,5 @@
=== tests/cases/compiler/alwaysStrictModule5.ts ===
// Targeting ES6
export const a = 1;
>a : Symbol(a, Decl(alwaysStrictModule5.ts, 2, 12))
>a : Symbol(a, Decl(alwaysStrictModule5.ts, 1, 12))
@@ -1,5 +1,4 @@
=== tests/cases/compiler/alwaysStrictModule5.ts ===
// Targeting ES6
export const a = 1;
>a : 1
@@ -1,5 +1,4 @@
//// [alwaysStrictModule6.ts]
// Targeting ES5
export const a = 1;
@@ -1,6 +1,5 @@
=== tests/cases/compiler/alwaysStrictModule6.ts ===
// Targeting ES5
export const a = 1;
>a : Symbol(a, Decl(alwaysStrictModule6.ts, 2, 12))
>a : Symbol(a, Decl(alwaysStrictModule6.ts, 1, 12))
@@ -1,5 +1,4 @@
=== tests/cases/compiler/alwaysStrictModule6.ts ===
// Targeting ES5
export const a = 1;
>a : 1
@@ -1,10 +1,9 @@
error TS5053: Option 'noImplicitUseStrict' cannot be specified with option 'alwaysStrict'.
tests/cases/compiler/alwaysStrictNoImplicitUseStrict.ts(4,13): error TS1100: Invalid use of 'arguments' in strict mode.
tests/cases/compiler/alwaysStrictNoImplicitUseStrict.ts(3,13): error TS1100: Invalid use of 'arguments' in strict mode.
!!! error TS5053: Option 'noImplicitUseStrict' cannot be specified with option 'alwaysStrict'.
==== tests/cases/compiler/alwaysStrictNoImplicitUseStrict.ts (1 errors) ====
module M {
export function f() {
var arguments = [];
@@ -1,5 +1,4 @@
//// [alwaysStrictNoImplicitUseStrict.ts]
module M {
export function f() {
var arguments = [];
@@ -13,14 +13,12 @@ declare class D extends C { }
var d: C = new D();
//// [ambientClassDeclarationExtends_file1.ts]
declare class E {
public bar;
}
namespace F { var y; }
//// [ambientClassDeclarationExtends_file2.ts]
declare class F extends E { }
var f: E = new F();
@@ -26,25 +26,23 @@ var d: C = new D();
>D : Symbol(D, Decl(ambientClassDeclarationExtends_singleFile.ts, 5, 1), Decl(ambientClassDeclarationExtends_singleFile.ts, 6, 22))
=== tests/cases/compiler/ambientClassDeclarationExtends_file1.ts ===
declare class E {
>E : Symbol(E, Decl(ambientClassDeclarationExtends_file1.ts, 0, 0))
public bar;
>bar : Symbol(E.bar, Decl(ambientClassDeclarationExtends_file1.ts, 1, 17))
>bar : Symbol(E.bar, Decl(ambientClassDeclarationExtends_file1.ts, 0, 17))
}
namespace F { var y; }
>F : Symbol(F, Decl(ambientClassDeclarationExtends_file1.ts, 3, 1), Decl(ambientClassDeclarationExtends_file2.ts, 0, 0))
>y : Symbol(y, Decl(ambientClassDeclarationExtends_file1.ts, 4, 17))
>F : Symbol(F, Decl(ambientClassDeclarationExtends_file1.ts, 2, 1), Decl(ambientClassDeclarationExtends_file2.ts, 0, 0))
>y : Symbol(y, Decl(ambientClassDeclarationExtends_file1.ts, 3, 17))
=== tests/cases/compiler/ambientClassDeclarationExtends_file2.ts ===
declare class F extends E { }
>F : Symbol(F, Decl(ambientClassDeclarationExtends_file1.ts, 3, 1), Decl(ambientClassDeclarationExtends_file2.ts, 0, 0))
>F : Symbol(F, Decl(ambientClassDeclarationExtends_file1.ts, 2, 1), Decl(ambientClassDeclarationExtends_file2.ts, 0, 0))
>E : Symbol(E, Decl(ambientClassDeclarationExtends_file1.ts, 0, 0))
var f: E = new F();
>f : Symbol(f, Decl(ambientClassDeclarationExtends_file2.ts, 2, 3))
>f : Symbol(f, Decl(ambientClassDeclarationExtends_file2.ts, 1, 3))
>E : Symbol(E, Decl(ambientClassDeclarationExtends_file1.ts, 0, 0))
>F : Symbol(F, Decl(ambientClassDeclarationExtends_file1.ts, 3, 1), Decl(ambientClassDeclarationExtends_file2.ts, 0, 0))
>F : Symbol(F, Decl(ambientClassDeclarationExtends_file1.ts, 2, 1), Decl(ambientClassDeclarationExtends_file2.ts, 0, 0))
@@ -27,7 +27,6 @@ var d: C = new D();
>D : typeof D
=== tests/cases/compiler/ambientClassDeclarationExtends_file1.ts ===
declare class E {
>E : E
@@ -39,7 +38,6 @@ namespace F { var y; }
>y : any
=== tests/cases/compiler/ambientClassDeclarationExtends_file2.ts ===
declare class F extends E { }
>F : F
>E : E
@@ -1,13 +1,12 @@
=== tests/cases/compiler/a.d.ts ===
declare namespace ns {
>ns : Symbol(ns, Decl(a.d.ts, 0, 0))
class SecondNS extends FirstNS { }
>SecondNS : Symbol(SecondNS, Decl(a.d.ts, 1, 22))
>FirstNS : Symbol(FirstNS, Decl(a.d.ts, 2, 36))
>SecondNS : Symbol(SecondNS, Decl(a.d.ts, 0, 22))
>FirstNS : Symbol(FirstNS, Decl(a.d.ts, 1, 36))
class FirstNS { }
>FirstNS : Symbol(FirstNS, Decl(a.d.ts, 2, 36))
>FirstNS : Symbol(FirstNS, Decl(a.d.ts, 1, 36))
}
@@ -1,5 +1,4 @@
=== tests/cases/compiler/a.d.ts ===
declare namespace ns {
>ns : typeof ns
@@ -1,5 +1,4 @@
//// [ambientConstLiterals.ts]
function f<T>(x: T): T {
return x;
}
@@ -1,74 +1,73 @@
=== tests/cases/compiler/ambientConstLiterals.ts ===
function f<T>(x: T): T {
>f : Symbol(f, Decl(ambientConstLiterals.ts, 0, 0))
>T : Symbol(T, Decl(ambientConstLiterals.ts, 1, 11))
>x : Symbol(x, Decl(ambientConstLiterals.ts, 1, 14))
>T : Symbol(T, Decl(ambientConstLiterals.ts, 1, 11))
>T : Symbol(T, Decl(ambientConstLiterals.ts, 1, 11))
>T : Symbol(T, Decl(ambientConstLiterals.ts, 0, 11))
>x : Symbol(x, Decl(ambientConstLiterals.ts, 0, 14))
>T : Symbol(T, Decl(ambientConstLiterals.ts, 0, 11))
>T : Symbol(T, Decl(ambientConstLiterals.ts, 0, 11))
return x;
>x : Symbol(x, Decl(ambientConstLiterals.ts, 1, 14))
>x : Symbol(x, Decl(ambientConstLiterals.ts, 0, 14))
}
enum E { A, B, C }
>E : Symbol(E, Decl(ambientConstLiterals.ts, 3, 1))
>A : Symbol(E.A, Decl(ambientConstLiterals.ts, 5, 8))
>B : Symbol(E.B, Decl(ambientConstLiterals.ts, 5, 11))
>C : Symbol(E.C, Decl(ambientConstLiterals.ts, 5, 14))
>E : Symbol(E, Decl(ambientConstLiterals.ts, 2, 1))
>A : Symbol(E.A, Decl(ambientConstLiterals.ts, 4, 8))
>B : Symbol(E.B, Decl(ambientConstLiterals.ts, 4, 11))
>C : Symbol(E.C, Decl(ambientConstLiterals.ts, 4, 14))
const c1 = "abc";
>c1 : Symbol(c1, Decl(ambientConstLiterals.ts, 7, 5))
>c1 : Symbol(c1, Decl(ambientConstLiterals.ts, 6, 5))
const c2 = 123;
>c2 : Symbol(c2, Decl(ambientConstLiterals.ts, 8, 5))
>c2 : Symbol(c2, Decl(ambientConstLiterals.ts, 7, 5))
const c3 = c1;
>c3 : Symbol(c3, Decl(ambientConstLiterals.ts, 9, 5))
>c1 : Symbol(c1, Decl(ambientConstLiterals.ts, 7, 5))
>c3 : Symbol(c3, Decl(ambientConstLiterals.ts, 8, 5))
>c1 : Symbol(c1, Decl(ambientConstLiterals.ts, 6, 5))
const c4 = c2;
>c4 : Symbol(c4, Decl(ambientConstLiterals.ts, 10, 5))
>c2 : Symbol(c2, Decl(ambientConstLiterals.ts, 8, 5))
>c4 : Symbol(c4, Decl(ambientConstLiterals.ts, 9, 5))
>c2 : Symbol(c2, Decl(ambientConstLiterals.ts, 7, 5))
const c5 = f(123);
>c5 : Symbol(c5, Decl(ambientConstLiterals.ts, 11, 5))
>c5 : Symbol(c5, Decl(ambientConstLiterals.ts, 10, 5))
>f : Symbol(f, Decl(ambientConstLiterals.ts, 0, 0))
const c6 = f(-123);
>c6 : Symbol(c6, Decl(ambientConstLiterals.ts, 12, 5))
>c6 : Symbol(c6, Decl(ambientConstLiterals.ts, 11, 5))
>f : Symbol(f, Decl(ambientConstLiterals.ts, 0, 0))
const c7 = true;
>c7 : Symbol(c7, Decl(ambientConstLiterals.ts, 13, 5))
>c7 : Symbol(c7, Decl(ambientConstLiterals.ts, 12, 5))
const c8 = E.A;
>c8 : Symbol(c8, Decl(ambientConstLiterals.ts, 14, 5))
>E.A : Symbol(E.A, Decl(ambientConstLiterals.ts, 5, 8))
>E : Symbol(E, Decl(ambientConstLiterals.ts, 3, 1))
>A : Symbol(E.A, Decl(ambientConstLiterals.ts, 5, 8))
>c8 : Symbol(c8, Decl(ambientConstLiterals.ts, 13, 5))
>E.A : Symbol(E.A, Decl(ambientConstLiterals.ts, 4, 8))
>E : Symbol(E, Decl(ambientConstLiterals.ts, 2, 1))
>A : Symbol(E.A, Decl(ambientConstLiterals.ts, 4, 8))
const c9 = { x: "abc" };
>c9 : Symbol(c9, Decl(ambientConstLiterals.ts, 15, 5))
>x : Symbol(x, Decl(ambientConstLiterals.ts, 15, 12))
>c9 : Symbol(c9, Decl(ambientConstLiterals.ts, 14, 5))
>x : Symbol(x, Decl(ambientConstLiterals.ts, 14, 12))
const c10 = [123];
>c10 : Symbol(c10, Decl(ambientConstLiterals.ts, 16, 5))
>c10 : Symbol(c10, Decl(ambientConstLiterals.ts, 15, 5))
const c11 = "abc" + "def";
>c11 : Symbol(c11, Decl(ambientConstLiterals.ts, 17, 5))
>c11 : Symbol(c11, Decl(ambientConstLiterals.ts, 16, 5))
const c12 = 123 + 456;
>c12 : Symbol(c12, Decl(ambientConstLiterals.ts, 18, 5))
>c12 : Symbol(c12, Decl(ambientConstLiterals.ts, 17, 5))
const c13 = Math.random() > 0.5 ? "abc" : "def";
>c13 : Symbol(c13, Decl(ambientConstLiterals.ts, 19, 5))
>c13 : Symbol(c13, Decl(ambientConstLiterals.ts, 18, 5))
>Math.random : Symbol(Math.random, Decl(lib.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>random : Symbol(Math.random, Decl(lib.d.ts, --, --))
const c14 = Math.random() > 0.5 ? 123 : 456;
>c14 : Symbol(c14, Decl(ambientConstLiterals.ts, 20, 5))
>c14 : Symbol(c14, Decl(ambientConstLiterals.ts, 19, 5))
>Math.random : Symbol(Math.random, Decl(lib.d.ts, --, --))
>Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>random : Symbol(Math.random, Decl(lib.d.ts, --, --))
@@ -1,5 +1,4 @@
=== tests/cases/compiler/ambientConstLiterals.ts ===
function f<T>(x: T): T {
>f : <T>(x: T) => T
>T : T
@@ -1,7 +1,6 @@
//// [tests/cases/conformance/ambient/ambientDeclarationsExternal.ts] ////
//// [decls.ts]
// Ambient external module with export assignment
declare module 'equ' {
var x;
@@ -10,27 +10,26 @@ import imp3 = require('equ2');
var n = imp3.x;
>n : Symbol(n, Decl(consumer.ts, 6, 3), Decl(consumer.ts, 7, 3))
>imp3.x : Symbol(imp3.x, Decl(decls.ts, 8, 7))
>imp3.x : Symbol(imp3.x, Decl(decls.ts, 7, 7))
>imp3 : Symbol(imp3, Decl(consumer.ts, 1, 29))
>x : Symbol(imp3.x, Decl(decls.ts, 8, 7))
>x : Symbol(imp3.x, Decl(decls.ts, 7, 7))
var n: number;
>n : Symbol(n, Decl(consumer.ts, 6, 3), Decl(consumer.ts, 7, 3))
=== tests/cases/conformance/ambient/decls.ts ===
// Ambient external module with export assignment
declare module 'equ' {
var x;
>x : Symbol(x, Decl(decls.ts, 3, 7))
>x : Symbol(x, Decl(decls.ts, 2, 7))
export = x;
>x : Symbol(x, Decl(decls.ts, 3, 7))
>x : Symbol(x, Decl(decls.ts, 2, 7))
}
declare module 'equ2' {
var x: number;
>x : Symbol(x, Decl(decls.ts, 8, 7))
>x : Symbol(x, Decl(decls.ts, 7, 7))
}
// Ambient external import declaration referencing ambient external module using top level module name
@@ -18,7 +18,6 @@ var n: number;
>n : number
=== tests/cases/conformance/ambient/decls.ts ===
// Ambient external module with export assignment
declare module 'equ' {
var x;
@@ -1,9 +1,8 @@
tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(5,16): error TS2664: Invalid module name in augmentation, module 'ext' cannot be found.
tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(10,22): error TS2307: Cannot find module 'ext'.
tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(4,16): error TS2664: Invalid module name in augmentation, module 'ext' cannot be found.
tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts(9,22): error TS2307: Cannot find module 'ext'.
==== tests/cases/compiler/ambientExternalModuleInAnotherExternalModule.ts (2 errors) ====
class D { }
export = D;
@@ -1,5 +1,4 @@
//// [ambientExternalModuleInAnotherExternalModule.ts]
class D { }
export = D;
@@ -1,9 +1,8 @@
tests/cases/compiler/ambientGetters.ts(3,9): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/ambientGetters.ts(7,9): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/ambientGetters.ts(2,9): error TS1086: An accessor cannot be declared in an ambient context.
tests/cases/compiler/ambientGetters.ts(6,9): error TS1086: An accessor cannot be declared in an ambient context.
==== tests/cases/compiler/ambientGetters.ts (2 errors) ====
declare class A {
get length() : number;
~~~~~~
@@ -1,5 +1,4 @@
//// [ambientGetters.ts]
declare class A {
get length() : number;
}
@@ -1,8 +1,6 @@
//// [tests/cases/compiler/ambientRequireFunction.ts] ////
//// [node.d.ts]
declare function require(moduleName: string): any;
declare module "fs" {
@@ -4,24 +4,22 @@
const fs = require("fs");
>fs : Symbol(fs, Decl(app.js, 2, 5))
>require : Symbol(require, Decl(node.d.ts, 0, 0))
>"fs" : Symbol("fs", Decl(node.d.ts, 2, 50))
>"fs" : Symbol("fs", Decl(node.d.ts, 0, 50))
const text = fs.readFileSync("/a/b/c");
>text : Symbol(text, Decl(app.js, 3, 5))
>fs.readFileSync : Symbol(readFileSync, Decl(node.d.ts, 4, 21))
>fs.readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21))
>fs : Symbol(fs, Decl(app.js, 2, 5))
>readFileSync : Symbol(readFileSync, Decl(node.d.ts, 4, 21))
>readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21))
=== tests/cases/compiler/node.d.ts ===
declare function require(moduleName: string): any;
>require : Symbol(require, Decl(node.d.ts, 0, 0))
>moduleName : Symbol(moduleName, Decl(node.d.ts, 2, 25))
>moduleName : Symbol(moduleName, Decl(node.d.ts, 0, 25))
declare module "fs" {
export function readFileSync(s: string): string;
>readFileSync : Symbol(readFileSync, Decl(node.d.ts, 4, 21))
>s : Symbol(s, Decl(node.d.ts, 5, 33))
>readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21))
>s : Symbol(s, Decl(node.d.ts, 3, 33))
}
@@ -16,8 +16,6 @@ const text = fs.readFileSync("/a/b/c");
>"/a/b/c" : "/a/b/c"
=== tests/cases/compiler/node.d.ts ===
declare function require(moduleName: string): any;
>require : (moduleName: string) => any
>moduleName : string
@@ -5,8 +5,8 @@ import m1 = require("m2")
m1.f();
//// [amdDependencyComment1.js]
///<amd-dependency path='bar'/>
"use strict";
///<amd-dependency path='bar'/>
exports.__esModule = true;
var m1 = require("m2");
m1.f();
@@ -5,8 +5,8 @@ import m1 = require("m2")
m1.f();
//// [amdDependencyCommentName1.js]
///<amd-dependency path='bar' name='b'/>
"use strict";
///<amd-dependency path='bar' name='b'/>
exports.__esModule = true;
var m1 = require("m2");
m1.f();
@@ -1,8 +1,7 @@
tests/cases/compiler/argumentsObjectIterator01_ES5.ts(4,21): error TS2495: Type 'IArguments' is not an array type or a string type.
tests/cases/compiler/argumentsObjectIterator01_ES5.ts(3,21): error TS2495: Type 'IArguments' is not an array type or a string type.
==== tests/cases/compiler/argumentsObjectIterator01_ES5.ts (1 errors) ====
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
let result = [];
for (let arg of arguments) {
@@ -1,5 +1,4 @@
//// [argumentsObjectIterator01_ES5.ts]
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
let result = [];
for (let arg of arguments) {
@@ -1,5 +1,4 @@
//// [argumentsObjectIterator01_ES6.ts]
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
let result = [];
for (let arg of arguments) {
@@ -1,25 +1,24 @@
=== tests/cases/compiler/argumentsObjectIterator01_ES6.ts ===
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
>doubleAndReturnAsArray : Symbol(doubleAndReturnAsArray, Decl(argumentsObjectIterator01_ES6.ts, 0, 0))
>x : Symbol(x, Decl(argumentsObjectIterator01_ES6.ts, 1, 32))
>y : Symbol(y, Decl(argumentsObjectIterator01_ES6.ts, 1, 42))
>z : Symbol(z, Decl(argumentsObjectIterator01_ES6.ts, 1, 53))
>x : Symbol(x, Decl(argumentsObjectIterator01_ES6.ts, 0, 32))
>y : Symbol(y, Decl(argumentsObjectIterator01_ES6.ts, 0, 42))
>z : Symbol(z, Decl(argumentsObjectIterator01_ES6.ts, 0, 53))
let result = [];
>result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 2, 7))
>result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 1, 7))
for (let arg of arguments) {
>arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 3, 12))
>arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 2, 12))
>arguments : Symbol(arguments)
result.push(arg + arg);
>result.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 2, 7))
>result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 1, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 3, 12))
>arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 3, 12))
>arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 2, 12))
>arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 2, 12))
}
return <[any, any, any]>result;
>result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 2, 7))
>result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 1, 7))
}
@@ -1,5 +1,4 @@
=== tests/cases/compiler/argumentsObjectIterator01_ES6.ts ===
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
>doubleAndReturnAsArray : (x: number, y: number, z: number) => [number, number, number]
>x : number
@@ -1,8 +1,7 @@
tests/cases/compiler/argumentsObjectIterator02_ES5.ts(3,26): error TS2304: Cannot find name 'Symbol'.
tests/cases/compiler/argumentsObjectIterator02_ES5.ts(2,26): error TS2304: Cannot find name 'Symbol'.
==== tests/cases/compiler/argumentsObjectIterator02_ES5.ts (1 errors) ====
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
let blah = arguments[Symbol.iterator];
~~~~~~
@@ -1,5 +1,4 @@
//// [argumentsObjectIterator02_ES5.ts]
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
let blah = arguments[Symbol.iterator];
@@ -1,5 +1,4 @@
//// [argumentsObjectIterator02_ES6.ts]
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
let blah = arguments[Symbol.iterator];
@@ -1,34 +1,33 @@
=== tests/cases/compiler/argumentsObjectIterator02_ES6.ts ===
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
>doubleAndReturnAsArray : Symbol(doubleAndReturnAsArray, Decl(argumentsObjectIterator02_ES6.ts, 0, 0))
>x : Symbol(x, Decl(argumentsObjectIterator02_ES6.ts, 1, 32))
>y : Symbol(y, Decl(argumentsObjectIterator02_ES6.ts, 1, 42))
>z : Symbol(z, Decl(argumentsObjectIterator02_ES6.ts, 1, 53))
>x : Symbol(x, Decl(argumentsObjectIterator02_ES6.ts, 0, 32))
>y : Symbol(y, Decl(argumentsObjectIterator02_ES6.ts, 0, 42))
>z : Symbol(z, Decl(argumentsObjectIterator02_ES6.ts, 0, 53))
let blah = arguments[Symbol.iterator];
>blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 2, 7))
>blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 1, 7))
>arguments : Symbol(arguments)
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
let result = [];
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 4, 7))
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 3, 7))
for (let arg of blah()) {
>arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 5, 12))
>blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 2, 7))
>arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 4, 12))
>blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 1, 7))
result.push(arg + arg);
>result.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 4, 7))
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 3, 7))
>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --))
>arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 5, 12))
>arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 5, 12))
>arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 4, 12))
>arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 4, 12))
}
return <[any, any, any]>result;
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 4, 7))
>result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 3, 7))
}
@@ -1,5 +1,4 @@
=== tests/cases/compiler/argumentsObjectIterator02_ES6.ts ===
function doubleAndReturnAsArray(x: number, y: number, z: number): [number, number, number] {
>doubleAndReturnAsArray : (x: number, y: number, z: number) => [number, number, number]
>x : number

Some files were not shown because too many files have changed in this diff Show More