Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index 0f6ce61c06f0bd58af6bae4d9887c3cf8b1ac6c1..fd8843da16cb6e40ff8ccd7c23746b1c6147e7b2 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -1685,6 +1685,15 @@ Maybe<bool> DefinePropertyWithInterceptorInternal( |
| // interceptor calls. |
| AssertNoContextChange ncc(isolate); |
| + // Throw if setter callback is defined and define property is called with a |
|
jochen (gone - plz use gerrit)
2016/09/14 08:43:01
how about only doing this if we don't have a defin
Franzi
2016/09/14 16:19:51
If I understand the IDL specification correctly, w
|
| + // non data descriptor. |
| + if (!interceptor->setter()->IsUndefined(isolate) && |
| + !PropertyDescriptor::IsDataDescriptor(&desc)) { |
| + isolate->Throw(*isolate->factory()->NewTypeError( |
| + MessageTemplate::kDefineDisallowedWithNonDataDescriptor, |
| + it->GetName())); |
| + return Nothing<bool>(); |
| + } |
| if (interceptor->definer()->IsUndefined(isolate)) return Just(false); |
| Handle<JSObject> holder = it->GetHolder<JSObject>(); |