mirror of
https://github.com/tc39/test262.git
synced 2025-10-18 14:23:54 +02:00
55 lines
1.8 KiB
JavaScript
55 lines
1.8 KiB
JavaScript
// This file was procedurally generated from the following sources:
|
|
// - src/accessor-names/literal-string-char-escape.case
|
|
// - src/accessor-names/default/cls-private-expr-static.template
|
|
/*---
|
|
description: Computed values as accessor property names (string literal containing a character escape sequence) (Class expression, static private method)
|
|
flags: [generated]
|
|
info: |
|
|
[...]
|
|
MethodDefinition[Yield, Await]:
|
|
PropertyNameClassElementName [?Yield, ?Await](
|
|
UniqueFormalParameters [~Yield, ~Await] ) {
|
|
FunctionBody [~Yield, ~Await] }
|
|
AsyncMethod[?Yield, ?Await]
|
|
get PropertyName ClassElementName [?Yield, ?Await] (){
|
|
FunctionBody [~Yield, ~Await] }
|
|
set PropertyNameClassElementName [?Yield, ?Await] (
|
|
PropertySetParameterList ) { FunctionBody [~Yield, ~Await] }
|
|
AsyncMethod [Yield, Await]:
|
|
async [no LineTerminator here] PropertyName
|
|
ClassElementName[?Yield, ?Await](
|
|
UniqueFormalParameters[~Yield, +Await] ) { AsyncFunctionBody }
|
|
|
|
|
|
12.2.6.7 Runtime Semantics: Evaluation
|
|
|
|
[...]
|
|
|
|
ComputedPropertyName : [ AssignmentExpression ]
|
|
|
|
1. Let exprValue be the result of evaluating AssignmentExpression.
|
|
2. Let propName be ? GetValue(exprValue).
|
|
3. Return ? ToPropertyKey(propName).
|
|
---*/
|
|
|
|
var stringSet;
|
|
|
|
var C = class {
|
|
static get #'character\tescape'() { return 'get string'; }
|
|
static set #'character\tescape'(param) { stringSet = param; }
|
|
|
|
static getPrivateReference() {
|
|
return this.#'character escape';
|
|
}
|
|
|
|
static setPrivateReference(value) {
|
|
this.#'character escape' = value;
|
|
}
|
|
};
|
|
|
|
|
|
assert.sameValue(C.getPrivateReference(), 'get string');
|
|
|
|
C.setPrivateReference('set string');
|
|
assert.sameValue(stringSet, 'set string');
|