Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 41b4fd4dbcdb7a8179e912efb007553618a098f9..efd81044199de84fe045f438af3a5c8cc838dd20 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -212,9 +212,10 @@ MaybeObject* Object::GetPropertyWithCallback(Object* receiver, |
// __defineGetter__ callback |
if (structure->IsFixedArray()) { |
Object* getter = FixedArray::cast(structure)->get(kGetterIndex); |
- if (getter->IsJSFunction()) { |
+ if (getter->IsSpecFunction()) { |
+ // TODO(rossberg): nicer would be to cast to some JSCallable here... |
return Object::GetPropertyWithDefinedGetter(receiver, |
- JSFunction::cast(getter)); |
+ JSReceiver::cast(getter)); |
} |
// Getter is not a function. |
return isolate->heap()->undefined_value(); |
@@ -255,17 +256,20 @@ MaybeObject* Object::GetPropertyWithHandler(Object* receiver_raw, |
MaybeObject* Object::GetPropertyWithDefinedGetter(Object* receiver, |
- JSFunction* getter) { |
+ JSReceiver* getter) { |
HandleScope scope; |
- Handle<JSFunction> fun(JSFunction::cast(getter)); |
+ Handle<JSReceiver> fun(JSReceiver::cast(getter)); |
Handle<Object> self(receiver); |
#ifdef ENABLE_DEBUGGER_SUPPORT |
Debug* debug = fun->GetHeap()->isolate()->debug(); |
// Handle stepping into a getter if step into is active. |
- if (debug->StepInActive()) { |
- debug->HandleStepIn(fun, Handle<Object>::null(), 0, false); |
+ // TODO(rossberg): should this apply to getters that are function proxies? |
+ if (debug->StepInActive() && fun->IsJSFunction()) { |
+ debug->HandleStepIn( |
+ Handle<JSFunction>::cast(fun), Handle<Object>::null(), 0, false); |
} |
#endif |
+ |
bool has_pending_exception; |
Handle<Object> result = |
Execution::Call(fun, self, 0, NULL, &has_pending_exception); |
@@ -1880,8 +1884,8 @@ MaybeObject* JSObject::SetPropertyWithCallback(Object* structure, |
if (structure->IsFixedArray()) { |
Object* setter = FixedArray::cast(structure)->get(kSetterIndex); |
- if (setter->IsJSFunction()) { |
- return SetPropertyWithDefinedSetter(JSFunction::cast(setter), value); |
+ if (setter->IsJSReceiver()) { |
+ return SetPropertyWithDefinedSetter(JSReceiver::cast(setter), value); |
} else { |
if (strict_mode == kNonStrictMode) { |
return value; |
@@ -1900,17 +1904,19 @@ MaybeObject* JSObject::SetPropertyWithCallback(Object* structure, |
} |
-MaybeObject* JSObject::SetPropertyWithDefinedSetter(JSFunction* setter, |
+MaybeObject* JSObject::SetPropertyWithDefinedSetter(JSReceiver* setter, |
Object* value) { |
Isolate* isolate = GetIsolate(); |
Handle<Object> value_handle(value, isolate); |
- Handle<JSFunction> fun(JSFunction::cast(setter), isolate); |
+ Handle<JSReceiver> fun(JSReceiver::cast(setter), isolate); |
Handle<JSObject> self(this, isolate); |
#ifdef ENABLE_DEBUGGER_SUPPORT |
Debug* debug = isolate->debug(); |
// Handle stepping into a setter if step into is active. |
- if (debug->StepInActive()) { |
- debug->HandleStepIn(fun, Handle<Object>::null(), 0, false); |
+ // TODO(rossberg): should this apply to getters that are function proxies? |
+ if (debug->StepInActive() && fun->IsJSFunction()) { |
+ debug->HandleStepIn( |
+ Handle<JSFunction>::cast(fun), Handle<Object>::null(), 0, false); |
} |
#endif |
bool has_pending_exception; |
@@ -3793,7 +3799,7 @@ MaybeObject* JSObject::DefineAccessor(String* name, |
bool is_getter, |
Object* fun, |
PropertyAttributes attributes) { |
- ASSERT(fun->IsJSFunction() || fun->IsUndefined()); |
+ ASSERT(fun->IsSpecFunction() || fun->IsUndefined()); |
Isolate* isolate = GetIsolate(); |
// Check access rights if needed. |
if (IsAccessCheckNeeded() && |