mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
23 lines
532 B
JavaScript
23 lines
532 B
JavaScript
// Copyright (C) 2014 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
/*---
|
|
es6id: 12.2.5
|
|
description: >
|
|
Computed property names for getters
|
|
---*/
|
|
var s = Symbol();
|
|
var A = {
|
|
get ["a"]() {
|
|
return "A";
|
|
},
|
|
get [1]() {
|
|
return 1;
|
|
},
|
|
get [s]() {
|
|
return s;
|
|
}
|
|
};
|
|
assert.sameValue(A.a, "A", "The value of `A.a` is `'A'`");
|
|
assert.sameValue(A[1], 1, "The value of `A[1]` is `1`");
|
|
assert.sameValue(A[s], s, "The value of `A[s]` is `Symbol()`");
|