mirror of https://github.com/tc39/test262.git
Assert early error for private names in method definitions
This commit is contained in:
parent
79fd1b2c76
commit
92a585f04a
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name even
|
||||
inside a class body (async method).
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private, async-functions, class, class-fields-public]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
field = {
|
||||
async #m() {}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name
|
||||
(async method).
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private, async-functions]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var o = {
|
||||
async #m() {}
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name even
|
||||
inside a class body. (async generator)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private, async-iteration, class, class-fields-public]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
field = {
|
||||
async * #m() {}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name.
|
||||
(async generator)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private, async-iteration]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var o = {
|
||||
async * #m() {}
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name even
|
||||
inside a class body. (generator)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private, generators, class, class-fields-public]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
field = {
|
||||
* #m() {}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name.
|
||||
(generator)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private, generators]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var o = {
|
||||
* #m() {}
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name even
|
||||
inside a class body. (getter method)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private, class, class-fields-public]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
field = {
|
||||
get #m() {}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name.
|
||||
(getter method)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var o = {
|
||||
get #m() {}
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name even
|
||||
inside a class body. (ordinary method)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private, class, class-fields-public]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
field = {
|
||||
#m() {}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name.
|
||||
(ordinary method)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var o = {
|
||||
#m() {}
|
||||
};
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name even
|
||||
inside a class body. (getter method)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private, class, class-fields-public]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
class C {
|
||||
field = {
|
||||
set #m(x) {}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-method-definitions-static-semantics-early-errors
|
||||
description: >
|
||||
Throws an early SyntaxError if a method definition has a private name.
|
||||
(getter method)
|
||||
info: |
|
||||
Static Semantics: Early Errors
|
||||
|
||||
PropertyDefinition : MethodDefinition
|
||||
It is a Syntax Error if PrivateBoundNames of MethodDefinition is non-empty.
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
features: [class-methods-private]
|
||||
---*/
|
||||
|
||||
$DONOTEVALUATE();
|
||||
|
||||
var o = {
|
||||
set #m(x) {}
|
||||
};
|
Loading…
Reference in New Issue