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

Unified Diff: src/js/v8natives.js

Issue 1517963002: Move Object.assign implementation to C++ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/prologue.js ('k') | test/mjsunit/harmony/proxies-object-assign.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/v8natives.js
diff --git a/src/js/v8natives.js b/src/js/v8natives.js
index edada890411815af9795f6eaebba1b6b53d3e923..e1971c8ee952053ec47d10a2bfcdb700fe481b52 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -804,12 +804,6 @@ function ObjectGetOwnPropertyDescriptor(obj, p) {
}
-// ES6 section 9.1.12 / 9.5.12
-function OwnPropertyKeys(obj) {
- return %GetOwnPropertyKeys(obj, PROPERTY_FILTER_NONE);
-}
-
-
// ES5 section 15.2.3.4.
function ObjectGetOwnPropertyNames(obj) {
obj = TO_OBJECT(obj);
@@ -916,36 +910,6 @@ function ObjectIsExtensible(obj) {
}
-// ES6 19.1.2.1
-function ObjectAssign(target, sources) {
- // TODO(bmeurer): Move this to toplevel.
- "use strict";
- var to = TO_OBJECT(target);
- var argsLen = %_ArgumentsLength();
- if (argsLen < 2) return to;
-
- for (var i = 1; i < argsLen; ++i) {
- var nextSource = %_Arguments(i);
- if (IS_NULL_OR_UNDEFINED(nextSource)) {
- continue;
- }
-
- var from = TO_OBJECT(nextSource);
- var keys = OwnPropertyKeys(from);
- var len = keys.length;
-
- for (var j = 0; j < len; ++j) {
- var key = keys[j];
- if (%PropertyIsEnumerable(from, key)) {
- var propValue = from[key];
- to[key] = propValue;
- }
- }
- }
- return to;
-}
-
-
// ES6 B.2.2.1.1
function ObjectGetProto() {
return %_GetPrototype(TO_OBJECT(this));
@@ -999,7 +963,7 @@ utils.InstallGetterSetter(GlobalObject.prototype, "__proto__", ObjectGetProto,
// Set up non-enumerable functions in the Object object.
utils.InstallFunctions(GlobalObject, DONT_ENUM, [
- "assign", ObjectAssign,
+ // assign is added in bootstrapper.cc.
"keys", ObjectKeys,
"create", ObjectCreate,
"defineProperty", ObjectDefineProperty,
« no previous file with comments | « src/js/prologue.js ('k') | test/mjsunit/harmony/proxies-object-assign.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698