1// Copyright 2015 the V8 project authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5var handler = { 6 ownKeys: function(t) { return ["a", "b"]; }, 7 getOwnPropertyDescriptor: function(t, p) { 8 return {enumerable: true, configurable: true} 9 }, 10 get: function(t, p) { 11 return 1; 12 } 13}; 14 15var proxy = new Proxy({}, handler); 16 17var o = {}; 18 19Object.assign(o, proxy); 20 21assertEquals({"a": 1, "b": 1}, o); 22 23(function TestStringSources() { 24 var source = "abc"; 25 var target = {}; 26 Object.assign(target, source); 27 assertEquals({0: "a", 1: "b", 2: "c"}, target); 28})(); 29