Parse an object literal property as shorthand unless followed by '(' or ':' (#28121)

This commit is contained in:
Andy
2018-10-26 15:00:31 -07:00
committed by GitHub
parent abce9ae0be
commit 36dfd775b3
40 changed files with 163 additions and 93 deletions
@@ -596,7 +596,8 @@ namespace ts {
{
compilerOptions: {
target: undefined,
module: ModuleKind.ESNext
module: ModuleKind.ESNext,
experimentalDecorators: true,
},
hasParseErrors: true
}
+1 -1
View File
@@ -141,7 +141,7 @@ namespace ts {
it("returns object with error when json is invalid", () => {
const parsed = parseConfigFileTextToJson("/apath/tsconfig.json", "invalid");
assert.deepEqual(parsed.config, { invalid: undefined });
assert.deepEqual(parsed.config, {});
const expected = createCompilerDiagnostic(Diagnostics._0_expected, "{");
const error = parsed.error!;
assert.equal(error.messageText, expected.messageText);