mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Support automatic semicolon insertion in class member declarations.
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration26.ts (2 errors) ====
|
||||
class C {
|
||||
var
|
||||
~~~
|
||||
!!! Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
public
|
||||
}
|
||||
~
|
||||
!!! Declaration or statement expected.
|
||||
12
tests/baselines/reference/parserClassDeclaration26.js
Normal file
12
tests/baselines/reference/parserClassDeclaration26.js
Normal file
@@ -0,0 +1,12 @@
|
||||
//// [parserClassDeclaration26.ts]
|
||||
class C {
|
||||
var
|
||||
public
|
||||
}
|
||||
|
||||
//// [parserClassDeclaration26.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
@@ -1,24 +0,0 @@
|
||||
==== tests/cases/compiler/varAsID.ts (2 errors) ====
|
||||
|
||||
class Foo {
|
||||
var; // ok
|
||||
x=1;
|
||||
}
|
||||
|
||||
var f = new Foo();
|
||||
|
||||
|
||||
class Foo2 {
|
||||
var // not an error, because of ASI.
|
||||
~~~
|
||||
!!! Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
x=1;
|
||||
}
|
||||
~
|
||||
!!! Declaration or statement expected.
|
||||
|
||||
var f2 = new Foo2();
|
||||
|
||||
|
||||
|
||||
|
||||
36
tests/baselines/reference/varAsID.js
Normal file
36
tests/baselines/reference/varAsID.js
Normal file
@@ -0,0 +1,36 @@
|
||||
//// [varAsID.ts]
|
||||
|
||||
class Foo {
|
||||
var; // ok
|
||||
x=1;
|
||||
}
|
||||
|
||||
var f = new Foo();
|
||||
|
||||
|
||||
class Foo2 {
|
||||
var // not an error, because of ASI.
|
||||
x=1;
|
||||
}
|
||||
|
||||
var f2 = new Foo2();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//// [varAsID.js]
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
this.x = 1;
|
||||
}
|
||||
return Foo;
|
||||
})();
|
||||
var f = new Foo();
|
||||
var Foo2 = (function () {
|
||||
function Foo2() {
|
||||
this.x = 1;
|
||||
}
|
||||
return Foo2;
|
||||
})();
|
||||
var f2 = new Foo2();
|
||||
Reference in New Issue
Block a user