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

Unified Diff: src/v8natives.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/harmony-object.js ('k') | test/js-perf-test/JSTests.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 6106ae9146316b627cbc5f28f7a2cb561110e355..d022348a66cca8337f1fcaa5488803e587041282 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1262,6 +1262,36 @@ function ObjectIs(obj1, obj2) {
}
+// ECMA-262, Edition 6, section 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 (%IsPropertyEnumerable(from, key)) {
+ var propValue = from[key];
+ to[key] = propValue;
+ }
+ }
+ }
+ return to;
+}
+
+
// ECMA-262, Edition 6, section B.2.2.1.1
function ObjectGetProto() {
return %_GetPrototype(TO_OBJECT(this));
@@ -1316,6 +1346,7 @@ utils.InstallGetterSetter(GlobalObject.prototype, "__proto__", ObjectGetProto,
// Set up non-enumerable functions in the Object object.
utils.InstallFunctions(GlobalObject, DONT_ENUM, [
+ "assign", ObjectAssign,
"keys", ObjectKeys,
"create", ObjectCreate,
"defineProperty", ObjectDefineProperty,
@@ -1808,7 +1839,6 @@ utils.Export(function(to) {
to.ObjectIsFrozen = ObjectIsFrozen;
to.ObjectIsSealed = ObjectIsSealed;
to.ObjectToString = ObjectToString;
- to.OwnPropertyKeys = OwnPropertyKeys;
to.ToNameArray = ToNameArray;
});
« no previous file with comments | « src/harmony-object.js ('k') | test/js-perf-test/JSTests.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698