mirror of
https://github.com/tc39/test262.git
synced 2025-07-16 10:34:44 +02:00
24 lines
723 B
Plaintext
24 lines
723 B
Plaintext
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
/*---
|
|
desc: Rest operation follows [[OwnPropertyKeys]] order
|
|
template: default
|
|
esid: pending
|
|
includes: [compareArray.js]
|
|
features: [Symbol, object-rest]
|
|
---*/
|
|
|
|
//- setup
|
|
var rest;
|
|
var calls = [];
|
|
var o = { get z() { calls.push('z') }, get a() { calls.push('a') } };
|
|
Object.defineProperty(o, 1, { get: () => { calls.push(1) }, enumerable: true });
|
|
Object.defineProperty(o, Symbol('foo'), { get: () => { calls.push("Symbol(foo)") }, enumerable: true });
|
|
//- elems
|
|
{...rest}
|
|
//- vals
|
|
o
|
|
//- body
|
|
assert(compareArray(calls, [1, 'z', 'a', "Symbol(foo)"]));
|
|
assert.sameValue(Object.keys(rest).length, 3);
|