From 5c40df93411f521f307dffd5193ca38c5eec67bc Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Thu, 1 Sep 2016 16:58:31 -0400 Subject: [PATCH] fixed IsPlainObject --- TODO | 4 ++++ src/binder/is-plain-object.cc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/TODO b/TODO index 69f57907..7ab72501 100644 --- a/TODO +++ b/TODO @@ -42,6 +42,10 @@ Polish the changes/last_row_id API of .run() reduce the number of memory copies +optimize binding by creating bind maps when statements and transactions are +created. This way, we can eliminate overhead caused by the NextAnonIndex() +and GetNamedParameterIndex() functions + if we promisify run(), get(), all(), or each(), their performance will suffer if more than 3 arguments are passed (more than 2 bound arguments for each()) diff --git a/src/binder/is-plain-object.cc b/src/binder/is-plain-object.cc index 1ac36e99..1581c429 100644 --- a/src/binder/is-plain-object.cc +++ b/src/binder/is-plain-object.cc @@ -2,6 +2,9 @@ bool Binder::IsPlainObject(v8::Local obj) { v8::Local proto = obj->GetPrototype(); + v8::Local ctx = obj->CreationContext(); + ctx->Enter(); v8::Local baseProto = Nan::New()->GetPrototype(); + ctx->Exit(); return proto->StrictEquals(baseProto) || proto->StrictEquals(Nan::Null()); }