1 // Copyright 2014 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.
6 (function(global, utils) {
10 %CheckIsBootstrapping();
12 // -------------------------------------------------------------------
15 var GlobalObject = global.Object;
19 utils.Import(function(from) {
20 OwnPropertyKeys = from.OwnPropertyKeys;
23 // -------------------------------------------------------------------
25 // ES6, draft 04-03-15, section 19.1.2.1
26 function ObjectAssign(target, sources) {
27 var to = TO_OBJECT_INLINE(target);
28 var argsLen = %_ArgumentsLength();
29 if (argsLen < 2) return to;
31 for (var i = 1; i < argsLen; ++i) {
32 var nextSource = %_Arguments(i);
33 if (IS_NULL_OR_UNDEFINED(nextSource)) {
37 var from = TO_OBJECT_INLINE(nextSource);
38 var keys = OwnPropertyKeys(from);
39 var len = keys.length;
41 for (var j = 0; j < len; ++j) {
43 if (%IsPropertyEnumerable(from, key)) {
44 var propValue = from[key];
52 // Set up non-enumerable functions on the Object object.
53 utils.InstallFunctions(GlobalObject, DONT_ENUM, [
54 "assign", ObjectAssign