blob: a6fc26e683448c22adef729166413cf68151c4df [file] [edit]
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/expressions/class/accessor-name-static/
name: Class expression, static method
esid: sec-runtime-semantics-classdefinitionevaluation
info: |
[...]
21. For each ClassElement m in order from methods
a. If IsStatic of m is false, then
[...]
b. Else,
a. Let status be the result of performing PropertyDefinitionEvaluation
for m with arguments F and false.
features: [class]
---*/
var stringSet;
var C = class {
static get /*{ declareWith }*/() { return 'get string'; }
static set /*{ declareWith }*/(param) { stringSet = param; }
};
assert.sameValue(C[/*{ referenceWith }*/], 'get string');
C[/*{ referenceWith }*/] = 'set string';
assert.sameValue(stringSet, 'set string');