mirror of https://github.com/tc39/test262.git
Adding case to test invalid syntax when using PrivateName after '?.' (#2408)
This commit is contained in:
parent
21195de94c
commit
d89c2cd601
|
@ -0,0 +1,20 @@
|
||||||
|
// Copyright (C) 2019 Caio Lima (Igalia SL). All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
desc: PrivateName after '?.' is not valid syntax
|
||||||
|
info: |
|
||||||
|
Updated Productions
|
||||||
|
|
||||||
|
MemberExpression[Yield]:
|
||||||
|
MemberExpression[?Yield].PrivateName
|
||||||
|
template: syntax/invalid
|
||||||
|
features: [class-fields-private, optional-chaining]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- elements
|
||||||
|
#m = 'test262';
|
||||||
|
|
||||||
|
access(obj) {
|
||||||
|
return obj?.#m;
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-elements/grammar-private-field-optional-chaining.case
|
||||||
|
// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
|
||||||
|
/*---
|
||||||
|
description: PrivateName after '?.' is not valid syntax (class expression)
|
||||||
|
esid: prod-ClassElement
|
||||||
|
features: [class-fields-private, optional-chaining, class]
|
||||||
|
flags: [generated]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
info: |
|
||||||
|
Updated Productions
|
||||||
|
|
||||||
|
MemberExpression[Yield]:
|
||||||
|
MemberExpression[?Yield].PrivateName
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
var C = class {
|
||||||
|
#m = 'test262';
|
||||||
|
|
||||||
|
access(obj) {
|
||||||
|
return obj?.#m;
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,29 @@
|
||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/class-elements/grammar-private-field-optional-chaining.case
|
||||||
|
// - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template
|
||||||
|
/*---
|
||||||
|
description: PrivateName after '?.' is not valid syntax (class declaration)
|
||||||
|
esid: prod-ClassElement
|
||||||
|
features: [class-fields-private, optional-chaining, class]
|
||||||
|
flags: [generated]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
info: |
|
||||||
|
Updated Productions
|
||||||
|
|
||||||
|
MemberExpression[Yield]:
|
||||||
|
MemberExpression[?Yield].PrivateName
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
class C {
|
||||||
|
#m = 'test262';
|
||||||
|
|
||||||
|
access(obj) {
|
||||||
|
return obj?.#m;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue