Skip to content

Commit 5c40df9

Browse files
author
Joshua Wise
committed
fixed IsPlainObject
1 parent d819cea commit 5c40df9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

TODO

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ Polish the changes/last_row_id API of .run()
4242

4343
reduce the number of memory copies
4444

45+
optimize binding by creating bind maps when statements and transactions are
46+
created. This way, we can eliminate overhead caused by the NextAnonIndex()
47+
and GetNamedParameterIndex() functions
48+
4549
if we promisify run(), get(), all(), or each(), their performance will suffer
4650
if more than 3 arguments are passed (more than 2 bound arguments for each())
4751

src/binder/is-plain-object.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
bool Binder::IsPlainObject(v8::Local<v8::Object> obj) {
44
v8::Local<v8::Value> proto = obj->GetPrototype();
5+
v8::Local<v8::Context> ctx = obj->CreationContext();
6+
ctx->Enter();
57
v8::Local<v8::Value> baseProto = Nan::New<v8::Object>()->GetPrototype();
8+
ctx->Exit();
69
return proto->StrictEquals(baseProto) || proto->StrictEquals(Nan::Null());
710
}

0 commit comments

Comments
 (0)