22//
33
44#include " better_sqlite3.hpp"
5- #line 165 "./src/util/macros.lzz"
5+ #line 167 "./src/util/macros.lzz"
66void SetPrototypeGetter (
77 v8::Isolate* isolate,
88 v8::Local<v8::External> data,
@@ -30,7 +30,7 @@ void SetPrototypeGetter(
3030 );
3131 #endif
3232}
33- #line 195 "./src/util/macros.lzz"
33+ #line 197 "./src/util/macros.lzz"
3434#ifndef V8_COMPRESS_POINTERS_IN_SHARED_CAGE
3535#define SAFE_NEW_BUFFER (env, data, length, finalizeCallback, finalizeHint ) node::Buffer::New(env, data, length, finalizeCallback, finalizeHint)
3636#else
@@ -118,28 +118,28 @@ void ThrowRangeError (char const * message)
118118#line 40 "./src/util/macros.lzz"
119119 { v8 :: Isolate * isolate = v8 :: Isolate :: GetCurrent ( ) ; isolate->ThrowException (v8::Exception::RangeError (StringFromUtf8 (isolate, message, -1 )));
120120}
121- #line 117 "./src/util/macros.lzz"
121+ #line 119 "./src/util/macros.lzz"
122122v8::Local <v8::FunctionTemplate> NewConstructorTemplate (v8::Isolate * isolate, v8::Local <v8::External> data, v8::FunctionCallback func, char const * name)
123- #line 122 "./src/util/macros.lzz"
123+ #line 124 "./src/util/macros.lzz"
124124 {
125125 v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New (isolate, func, data);
126126 t->InstanceTemplate ()->SetInternalFieldCount (1 );
127127 t->SetClassName (InternalizedFromLatin1 (isolate, name));
128128 return t;
129129}
130- #line 128 "./src/util/macros.lzz"
130+ #line 130 "./src/util/macros.lzz"
131131void SetPrototypeMethod (v8::Isolate * isolate, v8::Local <v8::External> data, v8::Local <v8::FunctionTemplate> recv, char const * name, v8::FunctionCallback func)
132- #line 134 "./src/util/macros.lzz"
132+ #line 136 "./src/util/macros.lzz"
133133 {
134134 v8::HandleScope scope (isolate);
135135 recv->PrototypeTemplate ()->Set (
136136 InternalizedFromLatin1 (isolate, name),
137137 v8::FunctionTemplate::New (isolate, func, data, v8::Signature::New (isolate, recv))
138138 );
139139}
140- #line 141 "./src/util/macros.lzz"
140+ #line 143 "./src/util/macros.lzz"
141141void SetPrototypeSymbolMethod (v8::Isolate * isolate, v8::Local <v8::External> data, v8::Local <v8::FunctionTemplate> recv, v8::Local <v8::Symbol> symbol, v8::FunctionCallback func)
142- #line 147 "./src/util/macros.lzz"
142+ #line 149 "./src/util/macros.lzz"
143143 {
144144 v8::HandleScope scope (isolate);
145145 recv->PrototypeTemplate ()->Set (
@@ -1020,7 +1020,7 @@ BindMap * Statement::GetBindMap (v8::Isolate * isolate)
10201020 int param_count = sqlite3_bind_parameter_count (handle);
10211021 for (int i = 1 ; i <= param_count; ++i) {
10221022 const char * name = sqlite3_bind_parameter_name (handle, i);
1023- if (name != NULL ) bind_map->Add (isolate, name + 1 , i);
1023+ if ( ( name != NULL && name [ 0 ] != ' ? ' ) ) bind_map->Add (isolate, name + 1 , i);
10241024 }
10251025 has_bind_map = true ;
10261026 return bind_map;
@@ -2221,12 +2221,19 @@ void Binder::Fail (void (* Throw) (char const *), char const * message)
22212221int Binder::NextAnonIndex ()
22222222#line 63 "./src/util/binder.lzz"
22232223 {
2224- while (sqlite3_bind_parameter_name (handle, ++anon_index) != NULL ) {}
2224+
2225+ while (true ) {
2226+ const char * name = sqlite3_bind_parameter_name (handle, ++anon_index);
2227+ if (! ( name != NULL && name [ 0 ] != ' ?' ) ) {
2228+ break ;
2229+ }
2230+ }
2231+
22252232 return anon_index;
22262233}
2227- #line 69 "./src/util/binder.lzz"
2234+ #line 76 "./src/util/binder.lzz"
22282235void Binder::BindValue (v8::Isolate * isolate, v8::Local <v8::Value> value, int index)
2229- #line 69 "./src/util/binder.lzz"
2236+ #line 76 "./src/util/binder.lzz"
22302237 {
22312238 int status = Data::BindValueFromJS (isolate, handle, index, value);
22322239 if (status != SQLITE_OK) {
@@ -2245,9 +2252,9 @@ void Binder::BindValue (v8::Isolate * isolate, v8::Local <v8::Value> value, int
22452252 assert (false );
22462253 }
22472254}
2248- #line 90 "./src/util/binder.lzz"
2255+ #line 97 "./src/util/binder.lzz"
22492256int Binder::BindArray (v8::Isolate * isolate, v8::Local <v8::Array> arr)
2250- #line 90 "./src/util/binder.lzz"
2257+ #line 97 "./src/util/binder.lzz"
22512258 {
22522259 v8 :: Local < v8 :: Context > ctx = isolate -> GetCurrentContext ( ) ;
22532260 uint32_t length = arr->Length ();
@@ -2269,9 +2276,9 @@ int Binder::BindArray (v8::Isolate * isolate, v8::Local <v8::Array> arr)
22692276 }
22702277 return len;
22712278}
2272- #line 116 "./src/util/binder.lzz"
2279+ #line 123 "./src/util/binder.lzz"
22732280int Binder::BindObject (v8::Isolate * isolate, v8::Local <v8::Object> obj, Statement * stmt)
2274- #line 116 "./src/util/binder.lzz"
2281+ #line 123 "./src/util/binder.lzz"
22752282 {
22762283 v8 :: Local < v8 :: Context > ctx = isolate -> GetCurrentContext ( ) ;
22772284 BindMap* bind_map = stmt->GetBindMap (isolate);
@@ -2308,9 +2315,9 @@ int Binder::BindObject (v8::Isolate * isolate, v8::Local <v8::Object> obj, State
23082315
23092316 return len;
23102317}
2311- #line 160 "./src/util/binder.lzz"
2318+ #line 167 "./src/util/binder.lzz"
23122319Binder::Result Binder::BindArgs (v8::FunctionCallbackInfo <v8 :: Value> const & info, int argc, Statement * stmt)
2313- #line 160 "./src/util/binder.lzz"
2320+ #line 167 "./src/util/binder.lzz"
23142321 {
23152322 v8 :: Isolate * isolate = info . GetIsolate ( ) ;
23162323 int count = 0 ;
0 commit comments