Add a couple more tests for ASI with fields. (#2128)

This commit is contained in:
Jason Orendorff 2019-04-17 09:55:01 -05:00 committed by Leo Balter
parent 8e5ab69e8c
commit 1988988a10
4 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,17 @@
// Copyright (C) 2019 Jason Orendorff. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: ASI test in field declarations -- error when method on same line
esid: sec-automatic-semicolon-insertion
features: [class, class-fields-public]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
var C = class {
field /* no ASI here */ method(){}
}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2019 Jason Orendorff. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: ASI test in field declarations -- error when method on same line after initializer
esid: sec-automatic-semicolon-insertion
features: [class, class-fields-public]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
var C = class {
field = 1 /* no ASI here */ method(){}
}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2019 Jason Orendorff. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: ASI test in field declarations -- error when method on same line
esid: sec-automatic-semicolon-insertion
features: [class, class-fields-public]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
class C {
field /* no ASI here */ method(){}
}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2019 Jason Orendorff. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: ASI test in field declarations -- error when method on same line after initializer
esid: sec-automatic-semicolon-insertion
features: [class, class-fields-public]
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
class C {
field = 1 /* no ASI here */ method(){}
}