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

Unified Diff: src/objects.cc

Issue 1451703003: [proxies] Wire up Object.getOwnPropertyDescriptor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: moved test file 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 | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index f5ad23396b9dd5c6d531c585f9be4ec938a093c9..daba153aaddd825277d9a5f7cc0bf0f6539bfaf6 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -6171,11 +6171,12 @@ bool JSReceiver::OrdinaryDefineOwnProperty(Isolate* isolate,
bool JSReceiver::OrdinaryDefineOwnProperty(LookupIterator* it,
PropertyDescriptor* desc,
ShouldThrow should_throw) {
+ Isolate* isolate = it->isolate();
// 1. Let current be O.[[GetOwnProperty]](P).
// 2. ReturnIfAbrupt(current).
PropertyDescriptor current;
if (!GetOwnPropertyDescriptor(it, &current) &&
- it->isolate()->has_pending_exception()) {
+ isolate->has_pending_exception()) {
return false;
}
// TODO(jkummerow/verwaest): It would be nice if we didn't have to reset
@@ -6187,35 +6188,35 @@ bool JSReceiver::OrdinaryDefineOwnProperty(LookupIterator* it,
Handle<JSObject> object = Handle<JSObject>::cast(it->GetReceiver());
bool extensible = JSObject::IsExtensible(object);
- return ValidateAndApplyPropertyDescriptor(it, extensible, desc, &current,
- should_throw);
+ return ValidateAndApplyPropertyDescriptor(isolate, it, extensible, desc,
+ &current, should_throw);
}
// ES6 9.1.6.2
// static
-bool JSReceiver::IsCompatiblePropertyDescriptor(bool extensible,
+bool JSReceiver::IsCompatiblePropertyDescriptor(Isolate* isolate,
+ bool extensible,
PropertyDescriptor* desc,
PropertyDescriptor* current,
Handle<Name> property_name) {
// 1. Return ValidateAndApplyPropertyDescriptor(undefined, undefined,
// Extensible, Desc, Current).
- return ValidateAndApplyPropertyDescriptor(NULL, extensible, desc, current,
- THROW_ON_ERROR, property_name);
+ return ValidateAndApplyPropertyDescriptor(
+ isolate, NULL, extensible, desc, current, THROW_ON_ERROR, property_name);
}
// ES6 9.1.6.3
// static
bool JSReceiver::ValidateAndApplyPropertyDescriptor(
- LookupIterator* it, bool extensible, PropertyDescriptor* desc,
- PropertyDescriptor* current, ShouldThrow should_throw,
- Handle<Name> property_name) {
+ Isolate* isolate, LookupIterator* it, bool extensible,
+ PropertyDescriptor* desc, PropertyDescriptor* current,
+ ShouldThrow should_throw, Handle<Name> property_name) {
// We either need a LookupIterator, or a property name.
DCHECK((it == NULL) != property_name.is_null());
Handle<JSObject> object;
if (it != NULL) object = Handle<JSObject>::cast(it->GetReceiver());
- Isolate* isolate = it->isolate();
bool desc_is_data_descriptor = PropertyDescriptor::IsDataDescriptor(desc);
bool desc_is_accessor_descriptor =
PropertyDescriptor::IsAccessorDescriptor(desc);
@@ -6868,7 +6869,7 @@ bool JSProxy::GetOwnPropertyDescriptor(LookupIterator* it,
PropertyDescriptor::CompletePropertyDescriptor(isolate, desc);
// 15. Let valid be IsCompatiblePropertyDescriptor (extensibleTarget,
// resultDesc, targetDesc).
- bool valid = IsCompatiblePropertyDescriptor(extensible_target, desc,
+ bool valid = IsCompatiblePropertyDescriptor(isolate, extensible_target, desc,
&target_desc, property_name);
// 16. If valid is false, throw a TypeError exception.
if (!valid) {
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698