The reason for the failing Delete() was the ObjectTemplate that was used to create the object. It had a SetProperty callback, a GetProperty callback, but no DeleteProperty. Once that was defined, the Delete() went through without any issues.
On Monday, March 21, 2016 at 12:48:41 PM UTC+2, Jochen Eisinger wrote: > > Assuming you don't have strong mode enabled, it looks like the property > the iterator is at is not deletable. Without seeing the entire source, it > is difficult to guess what goes wrong here. > > You could manually verify that the iterator for GetPropertyAttributes and > for DeleteProperty point at the same property. If they do, but you still > get different results, please file a bug with detailed repro steps. > > On Sun, Mar 20, 2016 at 3:00 PM Danny Dorfman <[email protected] > <javascript:>> wrote: > >> Hello again, >> >> I have a strange failure in the Delete method for objects (running 4.9). >> When I do: >> >> v8::Maybe<bool> delOk = obj->Delete(ctx,id); >> >> I get the return value "false". >> >> After stepping into V8 code, I see that it fails in >> JSReceiver::DeleteProperty(LookupIterator* >> it, LanguageMode language_mode), in this segment: >> ... >> case LookupIterator::ACCESSOR: { >> *if (!it->IsConfigurable() || receiver->map()->is_strong()) {* >> // Fail if the property is not configurable, or on a strong >> object. >> if (is_strict(language_mode)) { >> MessageTemplate::Template templ = >> receiver->map()->is_strong() >> ? MessageTemplate::kStrongDeleteProperty >> : MessageTemplate::kStrictDeleteProperty; >> isolate->Throw(*isolate->factory()->NewTypeError( >> templ, it->GetName(), receiver)); >> return Nothing<bool>(); >> } >> return Just(false); >> ... >> I noticed that it->IsConfigurable() returns false. However, after >> checking the property in my own code like this: >> >> auto maybeAttr = obj->GetPropertyAttributes(ctx, id); >> >> The attribute returns 2 (v8::DontEnum) only. >> >> Is there any other reason, why the property looks non-deletable to V8? >> >> -- >> -- >> v8-users mailing list >> [email protected] <javascript:> >> http://groups.google.com/group/v8-users >> --- >> You received this message because you are subscribed to the Google Groups >> "v8-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
