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

Unified Diff: src/js/v8natives.js

Issue 1456613002: [proxies] Update Object.defineProperty/ies for JSProxies (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 5 years, 1 month 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 | « no previous file | src/objects.h » ('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 06c315b8906c2df04135c4f9b849095bd69ee64e..6ffd074138695b3d038d065db9dd365c03cf1cbc 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -1010,44 +1010,15 @@ function ObjectCreate(proto, properties) {
// ES5 section 15.2.3.6.
function ObjectDefineProperty(obj, p, attributes) {
- // The new pure-C++ implementation doesn't support Proxies yet, nor O.o.
+ // The new pure-C++ implementation doesn't support O.o.
// TODO(jkummerow): Implement missing features and remove fallback path.
- if (%_IsJSProxy(obj) || %IsObserved(obj)) {
+ if (%IsObserved(obj)) {
if (!IS_SPEC_OBJECT(obj)) {
throw MakeTypeError(kCalledOnNonObject, "Object.defineProperty");
}
var name = TO_NAME(p);
- if (%_IsJSProxy(obj)) {
- // Clone the attributes object for protection.
- // TODO(rossberg): not spec'ed yet, so not sure if this should involve
- // non-own properties as it does (or non-enumerable ones, as it doesn't?).
- var attributesClone = { __proto__: null };
- for (var a in attributes) {
- attributesClone[a] = attributes[a];
- }
- DefineProxyProperty(obj, name, attributesClone, true);
- // The following would implement the spec as in the current proposal,
- // but after recent comments on es-discuss, is most likely obsolete.
- /*
- var defineObj = FromGenericPropertyDescriptor(desc);
- var names = ObjectGetOwnPropertyNames(attributes);
- var standardNames =
- {value: 0, writable: 0, get: 0, set: 0, enumerable: 0, configurable: 0};
- for (var i = 0; i < names.length; i++) {
- var N = names[i];
- if (!(%HasOwnProperty(standardNames, N))) {
- var attr = GetOwnPropertyJS(attributes, N);
- DefineOwnProperty(descObj, N, attr, true);
- }
- }
- // This is really confusing the types, but it is what the proxies spec
- // currently requires:
- desc = descObj;
- */
- } else {
- var desc = ToPropertyDescriptor(attributes);
- DefineOwnProperty(obj, name, desc, true);
- }
+ var desc = ToPropertyDescriptor(attributes);
+ DefineOwnProperty(obj, name, desc, true);
return obj;
}
return %ObjectDefineProperty(obj, p, attributes);
@@ -1078,9 +1049,9 @@ function GetOwnEnumerablePropertyNames(object) {
// ES5 section 15.2.3.7.
function ObjectDefineProperties(obj, properties) {
- // The new pure-C++ implementation doesn't support Proxies yet, nor O.o.
+ // The new pure-C++ implementation doesn't support O.o.
// TODO(jkummerow): Implement missing features and remove fallback path.
- if (%_IsJSProxy(obj) || %_IsJSProxy(properties) || %IsObserved(obj)) {
+ if (%IsObserved(obj)) {
if (!IS_SPEC_OBJECT(obj)) {
throw MakeTypeError(kCalledOnNonObject, "Object.defineProperties");
}
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698