Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Side by Side Diff: src/harmony-object.js

Issue 1356793002: Remove on-by-default flag --harmony-object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/v8natives.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4 //
5
6 (function(global, utils) {
7
8 "use strict";
9
10 %CheckIsBootstrapping();
11
12 // -------------------------------------------------------------------
13 // Imports
14
15 var GlobalObject = global.Object;
16 var OwnPropertyKeys;
17
18 utils.Import(function(from) {
19 OwnPropertyKeys = from.OwnPropertyKeys;
20 });
21
22 // -------------------------------------------------------------------
23
24 // ES6, draft 04-03-15, section 19.1.2.1
25 function ObjectAssign(target, sources) {
26 var to = TO_OBJECT(target);
27 var argsLen = %_ArgumentsLength();
28 if (argsLen < 2) return to;
29
30 for (var i = 1; i < argsLen; ++i) {
31 var nextSource = %_Arguments(i);
32 if (IS_NULL_OR_UNDEFINED(nextSource)) {
33 continue;
34 }
35
36 var from = TO_OBJECT(nextSource);
37 var keys = OwnPropertyKeys(from);
38 var len = keys.length;
39
40 for (var j = 0; j < len; ++j) {
41 var key = keys[j];
42 if (%IsPropertyEnumerable(from, key)) {
43 var propValue = from[key];
44 to[key] = propValue;
45 }
46 }
47 }
48 return to;
49 }
50
51 // Set up non-enumerable functions on the Object object.
52 utils.InstallFunctions(GlobalObject, DONT_ENUM, [
53 "assign", ObjectAssign
54 ]);
55
56 })
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698