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

Unified Diff: src/runtime.cc

Issue 542074: Fix crash when using Object.getOwnPropertyDescriptor on an API defined... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 3604)
+++ src/runtime.cc (working copy)
@@ -597,16 +597,22 @@
return Heap::undefined_value();
if (result.type() == CALLBACKS) {
- elms->set(0, Heap::true_value());
Object* structure = result.GetCallbackObject();
if (structure->IsProxy()) {
- Object* value = obj->GetPropertyWithCallback(
- obj, structure, name, result.holder());
- elms->set(1, value);
- elms->set(2, Heap::ToBoolean(!result.IsReadOnly()));
- } else {
+ // Property that is internally implemented as a callback.
+ Object* value = obj->GetPropertyWithCallback(
+ obj, structure, name, result.holder());
+ elms->set(0, Heap::false_value());
+ elms->set(1, value);
+ elms->set(2, Heap::ToBoolean(!result.IsReadOnly()));
+ } else if (structure->IsFixedArray()) {
+ // __defineGetter__/__defineSetter__ callback.
+ elms->set(0, Heap::true_value());
elms->set(1, FixedArray::cast(structure)->get(0));
elms->set(2, FixedArray::cast(structure)->get(1));
+ } else {
+ // TODO(ricow): Handle API callbacks.
+ return Heap::undefined_value();
}
} else {
elms->set(0, Heap::false_value());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698