refactor: use default printing path when no user options (#46616)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
f66c385080
commit
23035a587e
3 changed files with 34 additions and 14 deletions
|
@ -183,6 +183,16 @@ class Dictionary : public gin::Dictionary {
|
|||
|
||||
bool IsEmpty() const { return isolate() == nullptr || GetHandle().IsEmpty(); }
|
||||
|
||||
bool IsEmptyObject() const {
|
||||
if (IsEmpty())
|
||||
return true;
|
||||
|
||||
v8::Local<v8::Context> context = isolate()->GetCurrentContext();
|
||||
v8::Local<v8::Array> props =
|
||||
GetHandle()->GetOwnPropertyNames(context).ToLocalChecked();
|
||||
return props->Length() == 0;
|
||||
}
|
||||
|
||||
v8::Local<v8::Object> GetHandle() const {
|
||||
return gin::ConvertToV8(isolate(),
|
||||
*static_cast<const gin::Dictionary*>(this))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue