Add Dictionary::Delete

This commit is contained in:
Cheng Zhao 2015-11-11 00:25:10 +08:00
parent 21cda4e7fc
commit 9398494100

View file

@ -88,6 +88,12 @@ class Dictionary {
CallbackTraits<T>::CreateTemplate(isolate_, callback)->GetFunction());
}
bool Delete(const base::StringPiece& key) {
v8::Maybe<bool> result = GetHandle()->Delete(isolate_->GetCurrentContext(),
StringToV8(isolate_, key));
return !result.IsNothing() && result.FromJust();
}
bool IsEmpty() const { return isolate() == NULL; }
virtual v8::Local<v8::Object> GetHandle() const;