1 // Copyright (C) 2018 André Bargull. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
5 esid: sec-object.assign
7 Symbol-valued properties are copied after String-valued properties.
9 19.1.2.1 Object.assign ( target, ...sources )
12 4. For each element nextSource of sources, in ascending index order, do
15 i. Let from be ! ToObject(nextSource).
16 ii. Let keys be ? from.[[OwnPropertyKeys]]().
17 c. For each element nextKey of keys in List order, do
21 9.1.11.1 OrdinaryOwnPropertyKeys ( O )
24 3. For each own property key P of O that is a String but is not an integer index,
25 in ascending chronological order of property creation, do
26 a. Add P as the last element of keys.
27 4. For each own property key P of O that is a Symbol, in ascending chronological
28 order of property creation, do
29 a. Add P as the last element of keys.
32 includes: [compareArray.js]
37 var sym1 = Symbol("x");
38 var sym2 = Symbol("y");
42 Object.defineProperty(source, sym1, {
43 get: function(){ log.push("get sym(x)") },
44 enumerable: true, configurable: true,
46 Object.defineProperty(source, "a", {
47 get: function(){ log.push("get a") },
48 enumerable: true, configurable: true,
50 Object.defineProperty(source, sym2, {
51 get: function(){ log.push("get sym(y)") },
52 enumerable: true, configurable: true,
54 Object.defineProperty(source, "b", {
55 get: function(){ log.push("get b") },
56 enumerable: true, configurable: true,
59 var target = Object.assign({}, source);
61 assert.compareArray(log, ["get a", "get b", "get sym(x)", "get sym(y)"]);