Merge branch 'master' into strictNullChecks

This commit is contained in:
Anders Hejlsberg
2016-02-20 19:23:08 -08:00
15 changed files with 101 additions and 7 deletions
+1 -1
View File
@@ -12366,7 +12366,7 @@ namespace ts {
seen = c === node;
}
});
// We may be here because of some extra junk between overloads that could not be parsed into a valid node.
// We may be here because of some extra nodes between overloads that could not be parsed into a valid node.
// In this case the subsequent node is not really consecutive (.pos !== node.end), and we must ignore it here.
if (subsequentNode && subsequentNode.pos === node.end) {
if (subsequentNode.kind === node.kind) {
+7 -4
View File
@@ -710,16 +710,19 @@ namespace ts {
else {
const compilerOptions = extend(options, defaultInitCompilerOptions);
const configurations: any = {
compilerOptions: serializeCompilerOptions(compilerOptions)
compilerOptions: serializeCompilerOptions(compilerOptions)
};
if (fileNames && fileNames.length) {
// only set the files property if we have at least one file
configurations.files = fileNames;
}
else {
configurations.exclude = ["node_modules"];
}
else {
configurations.exclude = ["node_modules"];
if (compilerOptions.outDir) {
configurations.exclude.push(compilerOptions.outDir);
}
}
sys.writeFile(file, JSON.stringify(configurations, undefined, 4));
reportDiagnostic(createCompilerDiagnostic(Diagnostics.Successfully_created_a_tsconfig_json_file), /* compilerHost */ undefined);
+1 -1
View File
@@ -469,7 +469,7 @@ declare namespace ts.server.protocol {
placeOpenBraceOnNewLineForControlBlocks?: boolean;
/** Index operator */
[key: string] : string | number | boolean;
[key: string]: string | number | boolean;
}
/**
+1 -1
View File
@@ -2838,7 +2838,7 @@ namespace ts {
if (oldSourceFile) {
// We already had a source file for this file name. Go to the registry to
// ensure that we get the right up to date version of it. We need this to
// address the following 'race'. Specifically, say we have the following:
// address the following race-condition. Specifically, say we have the following:
//
// LS1
// \
@@ -0,0 +1,7 @@
//// [VariableDeclaration12_es6.ts]
let
x
//// [VariableDeclaration12_es6.js]
let x;
@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration12_es6.ts ===
let
x
>x : Symbol(x, Decl(VariableDeclaration12_es6.ts, 1, 3))
@@ -0,0 +1,6 @@
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration12_es6.ts ===
let
x
>x : any
@@ -0,0 +1,20 @@
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 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;
let[0] = 100;
~
!!! error TS1181: Array element destructuring pattern expected.
~
!!! error TS1005: ',' expected.
~
!!! error TS1134: Variable declaration expected.
~~~
!!! error TS1134: Variable declaration expected.
@@ -0,0 +1,13 @@
//// [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;
let[0] = 100;
//// [VariableDeclaration13_es6.js]
// 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;
let [] = 0;
100;
@@ -0,0 +1,7 @@
//// [letIdentifierInElementAccess01.ts]
var let: any = {};
(let[0] = 100);
//// [letIdentifierInElementAccess01.js]
var let = {};
(let[0] = 100);
@@ -0,0 +1,7 @@
=== tests/cases/conformance/expressions/elementAccess/letIdentifierInElementAccess01.ts ===
var let: any = {};
>let : Symbol(let, Decl(letIdentifierInElementAccess01.ts, 0, 3))
(let[0] = 100);
>let : Symbol(let, Decl(letIdentifierInElementAccess01.ts, 0, 3))
@@ -0,0 +1,13 @@
=== tests/cases/conformance/expressions/elementAccess/letIdentifierInElementAccess01.ts ===
var let: any = {};
>let : any
>{} : {}
(let[0] = 100);
>(let[0] = 100) : number
>let[0] = 100 : number
>let[0] : any
>let : any
>0 : number
>100 : number
@@ -0,0 +1,4 @@
// @target:es6
let
x
@@ -0,0 +1,6 @@
// @target:es6
// 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;
let[0] = 100;
@@ -0,0 +1,2 @@
var let: any = {};
(let[0] = 100);