Mike Pennisi d9ddf80479 Revert "Merge pull request #3219 from tc39/rwaldron/migrate-comparearray"
This reverts commit b690cb67be9b487eb10156c03e2c00869e88cc9d, reversing
changes made to 50dd431dffe5cf86e9064a652d6b01dbbe542cf0. This is
necessary because the reverted changeset reduced coverage by an unknown
extent.
2021-10-01 10:18:47 -04:00

34 lines
1.2 KiB
JavaScript

// This file was procedurally generated from the following sources:
// - src/dstr-assignment/obj-rest-order.case
// - src/dstr-assignment/default/assignment-expr.template
/*---
description: Rest operation follows [[OwnPropertyKeys]] order (AssignmentExpression)
esid: sec-variable-statement-runtime-semantics-evaluation
features: [Symbol, object-rest, destructuring-binding]
flags: [generated]
includes: [compareArray.js]
info: |
VariableDeclaration : BindingPattern Initializer
1. Let rhs be the result of evaluating Initializer.
2. Let rval be GetValue(rhs).
3. ReturnIfAbrupt(rval).
4. Return the result of performing BindingInitialization for
BindingPattern passing rval and undefined as arguments.
---*/
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 });
var result;
var vals = o;
result = {...rest} = vals;
assert(compareArray(calls, [1, 'z', 'a', "Symbol(foo)"]));
assert.sameValue(Object.keys(rest).length, 3);
assert.sameValue(result, vals);