> var sqlite3 = require('sqlite3');
> db = new sqlite3.Database('foo.db')
> o = { close: db.close };
> o.close()
node: /home/cananian/.node-gyp/0.10.22/src/node_object_wrap.h:61: static T* node::ObjectWrap::Unwrap(v8::Handle<v8::Object>) [with T = node_sqlite3::Database]: Assertion `handle->InternalFieldCount() > 0' failed.
Aborted
You should use the Signature parameter to v8 FunctionTemplate to prevent calling methods with the improper receiver type. (And then you should also use accessor.Holder() instead of accessor.This() when you unwrap.)
You should use the
Signatureparameter to v8FunctionTemplateto prevent calling methods with the improper receiver type. (And then you should also useaccessor.Holder()instead ofaccessor.This()when you unwrap.)