mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 11:54:44 -06:00
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com>
This commit is contained in:
parent
78ee4cacaf
commit
014dc3dc89
@ -1680,19 +1680,8 @@ namespace ts {
|
||||
return;
|
||||
}
|
||||
|
||||
// If an initializer was parsed but there is still an error in finding the next semicolon,
|
||||
// we generally know there was an error already reported in the initializer...
|
||||
// class Example { a = new Map([), ) }
|
||||
// ~
|
||||
if (initializer) {
|
||||
// ...unless we've found the start of a block after a property declaration, in which
|
||||
// case we can know that regardless of the initializer we should complain on the block.
|
||||
// class Example { a = 0 {} }
|
||||
// ~
|
||||
if (token() === SyntaxKind.OpenBraceToken) {
|
||||
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(SyntaxKind.SemicolonToken));
|
||||
}
|
||||
|
||||
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(SyntaxKind.SemicolonToken));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,28): error TS2304: Cannot find name 'DisplayPosition'.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,45): error TS1137: Expression or comma expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,46): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,46): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,49): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,51): error TS2300: Duplicate identifier '3'.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,52): error TS1005: ';' expected.
|
||||
@ -41,7 +41,7 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error T
|
||||
~
|
||||
!!! error TS1137: Expression or comma expected.
|
||||
~
|
||||
!!! error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
|
||||
17
tests/cases/fourslash/parserCorruptionAfterMapInClass.ts
Normal file
17
tests/cases/fourslash/parserCorruptionAfterMapInClass.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @target: esnext
|
||||
// @lib: es2015
|
||||
// @strict: true
|
||||
|
||||
//// class C {
|
||||
//// map = new Set<string, number>/*$*/
|
||||
////
|
||||
//// foo() {
|
||||
////
|
||||
//// }
|
||||
//// }
|
||||
|
||||
goTo.marker('$');
|
||||
edit.insert('()');
|
||||
verify.getSyntacticDiagnostics([]);
|
||||
Loading…
x
Reference in New Issue
Block a user