Accepting new baselines

This commit is contained in:
Anders Hejlsberg 2015-02-25 16:03:51 -08:00
parent 0e8b6dfdf4
commit 84760c298f
22 changed files with 100 additions and 106 deletions

View file

@ -756,7 +756,8 @@ declare module "typescript" {
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
isExportEquals?: boolean;
expression: Expression;
}
interface FileReference extends TextRange {
fileName: string;

View file

@ -2304,9 +2304,12 @@ declare module "typescript" {
>Statement : Statement
>ModuleElement : ModuleElement
exportName: Identifier;
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;
>isExportEquals : boolean
expression: Expression;
>expression : Expression
>Expression : Expression
}
interface FileReference extends TextRange {
>FileReference : FileReference

View file

@ -787,7 +787,8 @@ declare module "typescript" {
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
isExportEquals?: boolean;
expression: Expression;
}
interface FileReference extends TextRange {
fileName: string;

View file

@ -2450,9 +2450,12 @@ declare module "typescript" {
>Statement : Statement
>ModuleElement : ModuleElement
exportName: Identifier;
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;
>isExportEquals : boolean
expression: Expression;
>expression : Expression
>Expression : Expression
}
interface FileReference extends TextRange {
>FileReference : FileReference

View file

@ -788,7 +788,8 @@ declare module "typescript" {
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
isExportEquals?: boolean;
expression: Expression;
}
interface FileReference extends TextRange {
fileName: string;

View file

@ -2400,9 +2400,12 @@ declare module "typescript" {
>Statement : Statement
>ModuleElement : ModuleElement
exportName: Identifier;
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;
>isExportEquals : boolean
expression: Expression;
>expression : Expression
>Expression : Expression
}
interface FileReference extends TextRange {
>FileReference : FileReference

View file

@ -825,7 +825,8 @@ declare module "typescript" {
type ImportSpecifier = ImportOrExportSpecifier;
type ExportSpecifier = ImportOrExportSpecifier;
interface ExportAssignment extends Statement, ModuleElement {
exportName: Identifier;
isExportEquals?: boolean;
expression: Expression;
}
interface FileReference extends TextRange {
fileName: string;

View file

@ -2573,9 +2573,12 @@ declare module "typescript" {
>Statement : Statement
>ModuleElement : ModuleElement
exportName: Identifier;
>exportName : Identifier
>Identifier : Identifier
isExportEquals?: boolean;
>isExportEquals : boolean
expression: Expression;
>expression : Expression
>Expression : Expression
}
interface FileReference extends TextRange {
>FileReference : FileReference

View file

@ -1,15 +1,9 @@
tests/cases/conformance/externalModules/foo1.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/externalModules/foo2.ts(2,14): error TS1005: ';' expected.
tests/cases/conformance/externalModules/foo2.ts(2,15): error TS2304: Cannot find name 'x'.
==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ====
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
import foo1 = require('./foo1');
export = foo1.x; // Error, export assignment must be identifier only
~
!!! error TS1005: ';' expected.
~
!!! error TS2304: Cannot find name 'x'.
export = foo1.x; // Ok
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
export function x(){

View file

@ -7,7 +7,7 @@ export function x(){
//// [foo2.ts]
import foo1 = require('./foo1');
export = foo1.x; // Error, export assignment must be identifier only
export = foo1.x; // Ok
//// [foo1.js]
@ -17,5 +17,4 @@ function x() {
exports.x = x;
//// [foo2.js]
var foo1 = require('./foo1');
x; // Error, export assignment must be identifier only
module.exports = foo1;
module.exports = foo1.x;

View file

@ -1,55 +1,37 @@
tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/externalModules/foo1.ts(2,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo2.ts(1,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo3.ts(1,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo4.ts(1,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo6.ts(1,10): error TS1003: Identifier expected.
tests/cases/conformance/externalModules/foo3.ts(1,10): error TS1109: Expression expected.
tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression expected.
tests/cases/conformance/externalModules/foo7.ts(1,15): error TS1005: ';' expected.
tests/cases/conformance/externalModules/foo8.ts(1,10): error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ====
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
var x = 10;
export = typeof x; // Error
~~~~~~~~
export = typeof x; // Ok
~~~~~~~~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo2.ts (1 errors) ====
export = "sausages"; // Error
~~~~~~~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
export = "sausages"; // Ok
==== tests/cases/conformance/externalModules/foo3.ts (1 errors) ====
export = class Foo3 {}; // Error
export = class Foo3 {}; // Error, not an expression
~~~~~
!!! error TS1003: Identifier expected.
!!! error TS1109: Expression expected.
==== tests/cases/conformance/externalModules/foo4.ts (1 errors) ====
export = true; // Error
~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo4.ts (0 errors) ====
export = true; // Ok
==== tests/cases/conformance/externalModules/foo5.ts (0 errors) ====
export = undefined; // Valid. undefined is an identifier in JavaScript/TypeScript
==== tests/cases/conformance/externalModules/foo6.ts (2 errors) ====
export = void; // Error
~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo6.ts (1 errors) ====
export = void; // Error, void operator requires an argument
~
!!! error TS1109: Expression expected.
==== tests/cases/conformance/externalModules/foo7.ts (1 errors) ====
export = Date || String; // Error
~~
!!! error TS1005: ';' expected.
==== tests/cases/conformance/externalModules/foo7.ts (0 errors) ====
export = Date || String; // Ok
==== tests/cases/conformance/externalModules/foo8.ts (1 errors) ====
export = null; // Error
~~~~
!!! error TS1003: Identifier expected.
==== tests/cases/conformance/externalModules/foo8.ts (0 errors) ====
export = null; // Ok

View file

@ -2,51 +2,51 @@
//// [foo1.ts]
var x = 10;
export = typeof x; // Error
export = typeof x; // Ok
//// [foo2.ts]
export = "sausages"; // Error
export = "sausages"; // Ok
//// [foo3.ts]
export = class Foo3 {}; // Error
export = class Foo3 {}; // Error, not an expression
//// [foo4.ts]
export = true; // Error
export = true; // Ok
//// [foo5.ts]
export = undefined; // Valid. undefined is an identifier in JavaScript/TypeScript
//// [foo6.ts]
export = void; // Error
export = void; // Error, void operator requires an argument
//// [foo7.ts]
export = Date || String; // Error
export = Date || String; // Ok
//// [foo8.ts]
export = null; // Error
export = null; // Ok
//// [foo1.js]
var x = 10;
typeof x; // Error
module.exports = typeof x;
//// [foo2.js]
"sausages"; // Error
module.exports = "sausages";
//// [foo3.js]
var Foo3 = (function () {
function Foo3() {
}
return Foo3;
})();
; // Error
; // Error, not an expression
module.exports = ;
//// [foo4.js]
true; // Error
module.exports = true;
//// [foo5.js]
module.exports = undefined;
//// [foo6.js]
void ; // Error
module.exports = void ;
//// [foo7.js]
|| String; // Error
module.exports = Date;
module.exports = Date || String;
//// [foo8.js]
null; // Error
module.exports = null;

View file

@ -1,14 +0,0 @@
tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts(7,10): error TS1003: Identifier expected.
==== tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts (1 errors) ====
function Greeter() {
//...
}
Greeter.prototype.greet = function () {
//...
}
export = new Greeter();
~~~
!!! error TS1003: Identifier expected.

View file

@ -15,4 +15,4 @@ function Greeter() {
Greeter.prototype.greet = function () {
//...
};
new Greeter();
module.exports = new Greeter();

View file

@ -0,0 +1,21 @@
=== tests/cases/compiler/exportAssignmentWithoutIdentifier1.ts ===
function Greeter() {
>Greeter : () => void
//...
}
Greeter.prototype.greet = function () {
>Greeter.prototype.greet = function () { //...} : () => void
>Greeter.prototype.greet : any
>Greeter.prototype : any
>Greeter : () => void
>prototype : any
>greet : any
>function () { //...} : () => void
//...
}
export = new Greeter();
>new Greeter() : any
>Greeter : () => void

View file

@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,9): error TS1003: Identifier expected.
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,9): error TS1109: Expression expected.
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts (2 errors) ====
@ -7,4 +7,4 @@ tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignm
~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
!!! error TS1003: Identifier expected.
!!! error TS1109: Expression expected.

View file

@ -2,3 +2,4 @@
export =
//// [parserExportAssignment3.js]
module.exports = ;

View file

@ -1,5 +1,5 @@
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,10): error TS1003: Identifier expected.
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,10): error TS1109: Expression expected.
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts (2 errors) ====
@ -7,4 +7,4 @@ tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignm
~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~
!!! error TS1003: Identifier expected.
!!! error TS1109: Expression expected.

View file

@ -2,3 +2,4 @@
export = ;
//// [parserExportAssignment4.js]
module.exports = ;

View file

@ -1,12 +1,9 @@
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts(2,5): error TS1063: An export assignment cannot be used in an internal module.
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts(2,5): error TS2304: Cannot find name 'A'.
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts (2 errors) ====
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment5.ts (1 errors) ====
module M {
export = A;
~~~~~~~~~~~
!!! error TS1063: An export assignment cannot be used in an internal module.
~~~~~~~~~~~
!!! error TS2304: Cannot find name 'A'.
}

View file

@ -6,10 +6,9 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(44,9): error TS2332: 'this' cannot be referenced in current location.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(45,9): error TS2332: 'this' cannot be referenced in current location.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,10): error TS1003: Identifier expected.
==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts (9 errors) ====
==== tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts (8 errors) ====
//'this' in static member initializer
class ErrClass1 {
static t = this; // Error
@ -72,7 +71,5 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod
}
export = this; // Should be an error
~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~
!!! error TS1003: Identifier expected.
~~~~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.

View file

@ -108,4 +108,4 @@ var SomeEnum;
SomeEnum[SomeEnum["A"] = this] = "A";
SomeEnum[SomeEnum["B"] = this.spaaaace] = "B"; // Also should not be allowed
})(SomeEnum || (SomeEnum = {}));
this; // Should be an error
module.exports = this;