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

Unified Diff: src/v8natives.js

Issue 548833002: [es6] implement Object.assign (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use runtime %IsPropertyEnumerable() Created 5 years, 7 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 9c822b266b7c2e4607c41e718e3edcc62d45addc..2a6934cb48331af9248329a8019c6af9fa38f215 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -26,6 +26,7 @@ var $objectLookupGetter;
var $objectLookupSetter;
var $objectToString;
var $overrideFunction;
+var $ownPropertyKeys;
var $setFunctionName;
var $setUpLockedPrototype;
var $toCompletePropertyDescriptor;
@@ -1141,6 +1142,19 @@ function ObjectGetOwnPropertyKeys(obj, filter) {
}
+// ES6 section 9.1.12 / 9.5.12
+function OwnPropertyKeys(obj) {
+ if (%_IsJSProxy(obj)) {
+ var handler = %GetHandler(obj);
+ // TODO(caitp): Proxy.[[OwnPropertyKeys]] can not be implemented to spec
+ // without an implementation of Direct Proxies.
+ var names = CallTrap0(handler, "ownKeys", UNDEFINED);
+ return ToNameArray(names, "getOwnPropertyNames", false);
+ }
+ return ObjectGetOwnPropertyKeys(obj, PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL);
+}
+
+
// ES5 section 15.2.3.4.
function ObjectGetOwnPropertyNames(obj) {
obj = TO_OBJECT_INLINE(obj);
@@ -1943,6 +1957,7 @@ $objectLookupGetter = ObjectLookupGetter;
$objectLookupSetter = ObjectLookupSetter;
$objectToString = ObjectToString;
$overrideFunction = OverrideFunction;
+$ownPropertyKeys = OwnPropertyKeys;
$setFunctionName = SetFunctionName;
$setUpLockedPrototype = SetUpLockedPrototype;
$toCompletePropertyDescriptor = ToCompletePropertyDescriptor;
« 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