better-sqlite3-multiple-ciphers 7.6.3-beta.1 → 8.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,9 +31,9 @@
31
31
 
32
32
  #define SQLITE3MC_VERSION_MAJOR 1
33
33
  #define SQLITE3MC_VERSION_MINOR 5
34
- #define SQLITE3MC_VERSION_RELEASE 3
34
+ #define SQLITE3MC_VERSION_RELEASE 4
35
35
  #define SQLITE3MC_VERSION_SUBRELEASE 0
36
- #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.5.3"
36
+ #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.5.4"
37
37
 
38
38
  #endif /* SQLITE3MC_VERSION_H_ */
39
39
  /*** End of #include "sqlite3mc_version.h" ***/
@@ -192,9 +192,9 @@ extern "C" {
192
192
  ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
193
193
  ** [sqlite_version()] and [sqlite_source_id()].
194
194
  */
195
- #define SQLITE_VERSION "3.39.4"
196
- #define SQLITE_VERSION_NUMBER 3039004
197
- #define SQLITE_SOURCE_ID "2022-09-29 15:55:41 a29f9949895322123f7c38fbe94c649a9d6e6c9cd0c3b41c96d694552f26b309"
195
+ #define SQLITE_VERSION "3.40.0"
196
+ #define SQLITE_VERSION_NUMBER 3040000
197
+ #define SQLITE_SOURCE_ID "2022-11-16 12:10:08 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318"
198
198
 
199
199
  /*
200
200
  ** CAPI3REF: Run-Time Library Version Numbers
@@ -716,13 +716,17 @@ SQLITE_API int sqlite3_exec(
716
716
  **
717
717
  ** SQLite uses one of these integer values as the second
718
718
  ** argument to calls it makes to the xLock() and xUnlock() methods
719
- ** of an [sqlite3_io_methods] object.
719
+ ** of an [sqlite3_io_methods] object. These values are ordered from
720
+ ** lest restrictive to most restrictive.
721
+ **
722
+ ** The argument to xLock() is always SHARED or higher. The argument to
723
+ ** xUnlock is either SHARED or NONE.
720
724
  */
721
- #define SQLITE_LOCK_NONE 0
722
- #define SQLITE_LOCK_SHARED 1
723
- #define SQLITE_LOCK_RESERVED 2
724
- #define SQLITE_LOCK_PENDING 3
725
- #define SQLITE_LOCK_EXCLUSIVE 4
725
+ #define SQLITE_LOCK_NONE 0 /* xUnlock() only */
726
+ #define SQLITE_LOCK_SHARED 1 /* xLock() or xUnlock() */
727
+ #define SQLITE_LOCK_RESERVED 2 /* xLock() only */
728
+ #define SQLITE_LOCK_PENDING 3 /* xLock() only */
729
+ #define SQLITE_LOCK_EXCLUSIVE 4 /* xLock() only */
726
730
 
727
731
  /*
728
732
  ** CAPI3REF: Synchronization Type Flags
@@ -800,7 +804,14 @@ struct sqlite3_file {
800
804
  ** <li> [SQLITE_LOCK_PENDING], or
801
805
  ** <li> [SQLITE_LOCK_EXCLUSIVE].
802
806
  ** </ul>
803
- ** xLock() increases the lock. xUnlock() decreases the lock.
807
+ ** xLock() upgrades the database file lock. In other words, xLock() moves the
808
+ ** database file lock in the direction NONE toward EXCLUSIVE. The argument to
809
+ ** xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
810
+ ** SQLITE_LOCK_NONE. If the database file lock is already at or above the
811
+ ** requested lock, then the call to xLock() is a no-op.
812
+ ** xUnlock() downgrades the database file lock to either SHARED or NONE.
813
+ * If the lock is already at or below the requested lock state, then the call
814
+ ** to xUnlock() is a no-op.
804
815
  ** The xCheckReservedLock() method checks whether any database connection,
805
816
  ** either in this process or in some other process, is holding a RESERVED,
806
817
  ** PENDING, or EXCLUSIVE lock on the file. It returns true
@@ -905,9 +916,8 @@ struct sqlite3_io_methods {
905
916
  ** opcode causes the xFileControl method to write the current state of
906
917
  ** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
907
918
  ** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
908
- ** into an integer that the pArg argument points to. This capability
909
- ** is used during testing and is only available when the SQLITE_TEST
910
- ** compile-time option is used.
919
+ ** into an integer that the pArg argument points to.
920
+ ** This capability is only available if SQLite is compiled with [SQLITE_DEBUG].
911
921
  **
912
922
  ** <li>[[SQLITE_FCNTL_SIZE_HINT]]
913
923
  ** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
@@ -1299,6 +1309,26 @@ typedef struct sqlite3_mutex sqlite3_mutex;
1299
1309
  */
1300
1310
  typedef struct sqlite3_api_routines sqlite3_api_routines;
1301
1311
 
1312
+ /*
1313
+ ** CAPI3REF: File Name
1314
+ **
1315
+ ** Type [sqlite3_filename] is used by SQLite to pass filenames to the
1316
+ ** xOpen method of a [VFS]. It may be cast to (const char*) and treated
1317
+ ** as a normal, nul-terminated, UTF-8 buffer containing the filename, but
1318
+ ** may also be passed to special APIs such as:
1319
+ **
1320
+ ** <ul>
1321
+ ** <li> sqlite3_filename_database()
1322
+ ** <li> sqlite3_filename_journal()
1323
+ ** <li> sqlite3_filename_wal()
1324
+ ** <li> sqlite3_uri_parameter()
1325
+ ** <li> sqlite3_uri_boolean()
1326
+ ** <li> sqlite3_uri_int64()
1327
+ ** <li> sqlite3_uri_key()
1328
+ ** </ul>
1329
+ */
1330
+ typedef const char *sqlite3_filename;
1331
+
1302
1332
  /*
1303
1333
  ** CAPI3REF: OS Interface Object
1304
1334
  **
@@ -1477,7 +1507,7 @@ struct sqlite3_vfs {
1477
1507
  sqlite3_vfs *pNext; /* Next registered VFS */
1478
1508
  const char *zName; /* Name of this virtual file system */
1479
1509
  void *pAppData; /* Pointer to application-specific data */
1480
- int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*,
1510
+ int (*xOpen)(sqlite3_vfs*, sqlite3_filename zName, sqlite3_file*,
1481
1511
  int flags, int *pOutFlags);
1482
1512
  int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir);
1483
1513
  int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut);
@@ -2355,6 +2385,7 @@ struct sqlite3_mem_methods {
2355
2385
  ** <ul>
2356
2386
  ** <li> The [PRAGMA writable_schema=ON] statement.
2357
2387
  ** <li> The [PRAGMA journal_mode=OFF] statement.
2388
+ ** <li> The [PRAGMA schema_version=N] statement.
2358
2389
  ** <li> Writes to the [sqlite_dbpage] virtual table.
2359
2390
  ** <li> Direct writes to [shadow tables].
2360
2391
  ** </ul>
@@ -3470,6 +3501,9 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3470
3501
  ** <dd>The database is opened [shared cache] enabled, overriding
3471
3502
  ** the default shared cache setting provided by
3472
3503
  ** [sqlite3_enable_shared_cache()].)^
3504
+ ** The [use of shared cache mode is discouraged] and hence shared cache
3505
+ ** capabilities may be omitted from many builds of SQLite. In such cases,
3506
+ ** this option is a no-op.
3473
3507
  **
3474
3508
  ** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt>
3475
3509
  ** <dd>The database is opened [shared cache] disabled, overriding
@@ -3485,7 +3519,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3485
3519
  ** to return an extended result code.</dd>
3486
3520
  **
3487
3521
  ** [[OPEN_NOFOLLOW]] ^(<dt>[SQLITE_OPEN_NOFOLLOW]</dt>
3488
- ** <dd>The database filename is not allowed to be a symbolic link</dd>
3522
+ ** <dd>The database filename is not allowed to contain a symbolic link</dd>
3489
3523
  ** </dl>)^
3490
3524
  **
3491
3525
  ** If the 3rd parameter to sqlite3_open_v2() is not one of the
@@ -3744,10 +3778,10 @@ SQLITE_API int sqlite3_open_v2(
3744
3778
  **
3745
3779
  ** See the [URI filename] documentation for additional information.
3746
3780
  */
3747
- SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
3748
- SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
3749
- SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
3750
- SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N);
3781
+ SQLITE_API const char *sqlite3_uri_parameter(sqlite3_filename z, const char *zParam);
3782
+ SQLITE_API int sqlite3_uri_boolean(sqlite3_filename z, const char *zParam, int bDefault);
3783
+ SQLITE_API sqlite3_int64 sqlite3_uri_int64(sqlite3_filename, const char*, sqlite3_int64);
3784
+ SQLITE_API const char *sqlite3_uri_key(sqlite3_filename z, int N);
3751
3785
 
3752
3786
  /*
3753
3787
  ** CAPI3REF: Translate filenames
@@ -3776,9 +3810,9 @@ SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N);
3776
3810
  ** return value from [sqlite3_db_filename()], then the result is
3777
3811
  ** undefined and is likely a memory access violation.
3778
3812
  */
3779
- SQLITE_API const char *sqlite3_filename_database(const char*);
3780
- SQLITE_API const char *sqlite3_filename_journal(const char*);
3781
- SQLITE_API const char *sqlite3_filename_wal(const char*);
3813
+ SQLITE_API const char *sqlite3_filename_database(sqlite3_filename);
3814
+ SQLITE_API const char *sqlite3_filename_journal(sqlite3_filename);
3815
+ SQLITE_API const char *sqlite3_filename_wal(sqlite3_filename);
3782
3816
 
3783
3817
  /*
3784
3818
  ** CAPI3REF: Database File Corresponding To A Journal
@@ -3844,14 +3878,14 @@ SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*);
3844
3878
  ** then the corresponding [sqlite3_module.xClose() method should also be
3845
3879
  ** invoked prior to calling sqlite3_free_filename(Y).
3846
3880
  */
3847
- SQLITE_API char *sqlite3_create_filename(
3881
+ SQLITE_API sqlite3_filename sqlite3_create_filename(
3848
3882
  const char *zDatabase,
3849
3883
  const char *zJournal,
3850
3884
  const char *zWal,
3851
3885
  int nParam,
3852
3886
  const char **azParam
3853
3887
  );
3854
- SQLITE_API void sqlite3_free_filename(char*);
3888
+ SQLITE_API void sqlite3_free_filename(sqlite3_filename);
3855
3889
 
3856
3890
  /*
3857
3891
  ** CAPI3REF: Error Codes And Messages
@@ -5554,6 +5588,16 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
5554
5588
  ** then the conversion is performed. Otherwise no conversion occurs.
5555
5589
  ** The [SQLITE_INTEGER | datatype] after conversion is returned.)^
5556
5590
  **
5591
+ ** ^(The sqlite3_value_encoding(X) interface returns one of [SQLITE_UTF8],
5592
+ ** [SQLITE_UTF16BE], or [SQLITE_UTF16LE] according to the current encoding
5593
+ ** of the value X, assuming that X has type TEXT.)^ If sqlite3_value_type(X)
5594
+ ** returns something other than SQLITE_TEXT, then the return value from
5595
+ ** sqlite3_value_encoding(X) is meaningless. ^Calls to
5596
+ ** sqlite3_value_text(X), sqlite3_value_text16(X), sqlite3_value_text16be(X),
5597
+ ** sqlite3_value_text16le(X), sqlite3_value_bytes(X), or
5598
+ ** sqlite3_value_bytes16(X) might change the encoding of the value X and
5599
+ ** thus change the return from subsequent calls to sqlite3_value_encoding(X).
5600
+ **
5557
5601
  ** ^Within the [xUpdate] method of a [virtual table], the
5558
5602
  ** sqlite3_value_nochange(X) interface returns true if and only if
5559
5603
  ** the column corresponding to X is unchanged by the UPDATE operation
@@ -5618,6 +5662,7 @@ SQLITE_API int sqlite3_value_type(sqlite3_value*);
5618
5662
  SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
5619
5663
  SQLITE_API int sqlite3_value_nochange(sqlite3_value*);
5620
5664
  SQLITE_API int sqlite3_value_frombind(sqlite3_value*);
5665
+ SQLITE_API int sqlite3_value_encoding(sqlite3_value*);
5621
5666
 
5622
5667
  /*
5623
5668
  ** CAPI3REF: Finding The Subtype Of SQL Values
@@ -5671,7 +5716,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*);
5671
5716
  **
5672
5717
  ** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer
5673
5718
  ** when first called if N is less than or equal to zero or if a memory
5674
- ** allocate error occurs.
5719
+ ** allocation error occurs.
5675
5720
  **
5676
5721
  ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is
5677
5722
  ** determined by the N parameter on first successful call. Changing the
@@ -5876,9 +5921,10 @@ typedef void (*sqlite3_destructor_type)(void*);
5876
5921
  ** of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE].
5877
5922
  ** ^SQLite takes the text result from the application from
5878
5923
  ** the 2nd parameter of the sqlite3_result_text* interfaces.
5879
- ** ^If the 3rd parameter to the sqlite3_result_text* interfaces
5880
- ** is negative, then SQLite takes result text from the 2nd parameter
5881
- ** through the first zero character.
5924
+ ** ^If the 3rd parameter to any of the sqlite3_result_text* interfaces
5925
+ ** other than sqlite3_result_text64() is negative, then SQLite computes
5926
+ ** the string length itself by searching the 2nd parameter for the first
5927
+ ** zero character.
5882
5928
  ** ^If the 3rd parameter to the sqlite3_result_text* interfaces
5883
5929
  ** is non-negative, then as many bytes (not characters) of the text
5884
5930
  ** pointed to by the 2nd parameter are taken as the application-defined
@@ -6374,7 +6420,7 @@ SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N);
6374
6420
  ** <li> [sqlite3_filename_wal()]
6375
6421
  ** </ul>
6376
6422
  */
6377
- SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName);
6423
+ SQLITE_API sqlite3_filename sqlite3_db_filename(sqlite3 *db, const char *zDbName);
6378
6424
 
6379
6425
  /*
6380
6426
  ** CAPI3REF: Determine if a database is read-only
@@ -6511,7 +6557,7 @@ SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*);
6511
6557
  ** function C that is invoked prior to each autovacuum of the database
6512
6558
  ** file. ^The callback is passed a copy of the generic data pointer (P),
6513
6559
  ** the schema-name of the attached database that is being autovacuumed,
6514
- ** the the size of the database file in pages, the number of free pages,
6560
+ ** the size of the database file in pages, the number of free pages,
6515
6561
  ** and the number of bytes per page, respectively. The callback should
6516
6562
  ** return the number of free pages that should be removed by the
6517
6563
  ** autovacuum. ^If the callback returns zero, then no autovacuum happens.
@@ -6632,6 +6678,11 @@ SQLITE_API void *sqlite3_update_hook(
6632
6678
  ** to the same database. Sharing is enabled if the argument is true
6633
6679
  ** and disabled if the argument is false.)^
6634
6680
  **
6681
+ ** This interface is omitted if SQLite is compiled with
6682
+ ** [-DSQLITE_OMIT_SHARED_CACHE]. The [-DSQLITE_OMIT_SHARED_CACHE]
6683
+ ** compile-time option is recommended because the
6684
+ ** [use of shared cache mode is discouraged].
6685
+ **
6635
6686
  ** ^Cache sharing is enabled and disabled for an entire process.
6636
6687
  ** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]).
6637
6688
  ** In prior versions of SQLite,
@@ -6730,7 +6781,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*);
6730
6781
  ** ^The soft heap limit may not be greater than the hard heap limit.
6731
6782
  ** ^If the hard heap limit is enabled and if sqlite3_soft_heap_limit(N)
6732
6783
  ** is invoked with a value of N that is greater than the hard heap limit,
6733
- ** the the soft heap limit is set to the value of the hard heap limit.
6784
+ ** the soft heap limit is set to the value of the hard heap limit.
6734
6785
  ** ^The soft heap limit is automatically enabled whenever the hard heap
6735
6786
  ** limit is enabled. ^When sqlite3_hard_heap_limit64(N) is invoked and
6736
6787
  ** the soft heap limit is outside the range of 1..N, then the soft heap
@@ -9025,7 +9076,7 @@ typedef struct sqlite3_backup sqlite3_backup;
9025
9076
  ** if the application incorrectly accesses the destination [database connection]
9026
9077
  ** and so no error code is reported, but the operations may malfunction
9027
9078
  ** nevertheless. Use of the destination database connection while a
9028
- ** backup is in progress might also also cause a mutex deadlock.
9079
+ ** backup is in progress might also cause a mutex deadlock.
9029
9080
  **
9030
9081
  ** If running in [shared cache mode], the application must
9031
9082
  ** guarantee that the shared cache used by the destination database
@@ -9453,7 +9504,7 @@ SQLITE_API int sqlite3_wal_checkpoint_v2(
9453
9504
  */
9454
9505
  #define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking */
9455
9506
  #define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */
9456
- #define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for for readers */
9507
+ #define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for readers */
9457
9508
  #define SQLITE_CHECKPOINT_TRUNCATE 3 /* Like RESTART but also truncate WAL */
9458
9509
 
9459
9510
  /*
@@ -331,9 +331,9 @@ struct sqlite3_api_routines {
331
331
  const char *(*filename_journal)(const char*);
332
332
  const char *(*filename_wal)(const char*);
333
333
  /* Version 3.32.0 and later */
334
- char *(*create_filename)(const char*,const char*,const char*,
334
+ const char *(*create_filename)(const char*,const char*,const char*,
335
335
  int,const char**);
336
- void (*free_filename)(char*);
336
+ void (*free_filename)(const char*);
337
337
  sqlite3_file *(*database_file_object)(const char*);
338
338
  /* Version 3.34.0 and later */
339
339
  int (*txn_state)(sqlite3*,const char*);
@@ -357,6 +357,8 @@ struct sqlite3_api_routines {
357
357
  unsigned char *(*serialize)(sqlite3*,const char *,sqlite3_int64*,
358
358
  unsigned int);
359
359
  const char *(*db_name)(sqlite3*,int);
360
+ /* Version 3.40.0 and later */
361
+ int (*value_encoding)(sqlite3_value*);
360
362
  };
361
363
 
362
364
  /*
@@ -681,6 +683,8 @@ typedef int (*sqlite3_loadext_entry)(
681
683
  #define sqlite3_serialize sqlite3_api->serialize
682
684
  #endif
683
685
  #define sqlite3_db_name sqlite3_api->db_name
686
+ /* Version 3.40.0 and later */
687
+ #define sqlite3_value_encoding sqlite3_api->value_encoding
684
688
  #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
685
689
 
686
690
  #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-sqlite3-multiple-ciphers",
3
- "version": "7.6.3-beta.1",
3
+ "version": "8.0.1-beta.0",
4
4
  "description": "better-sqlite3 with multiple-cipher encryption support",
5
5
  "homepage": "https://github.com/m4heshd/better-sqlite3-multiple-ciphers",
6
6
  "author": "Mahesh Bandara Wijerathna (m4heshd) <m4heshd@gmail.com>",
@@ -25,12 +25,18 @@
25
25
  "cli-color": "^2.0.2",
26
26
  "fs-extra": "^10.1.0",
27
27
  "mocha": "^8.3.2",
28
+ "node-gyp": "8.4.1",
28
29
  "nodemark": "^0.3.0",
29
30
  "prebuild": "^11.0.4",
30
31
  "sqlite": "^4.1.1",
31
32
  "sqlite3": "^5.0.8",
32
33
  "@types/better-sqlite3": "latest"
33
34
  },
35
+ "overrides": {
36
+ "prebuild": {
37
+ "node-gyp": "$node-gyp"
38
+ }
39
+ },
34
40
  "scripts": {
35
41
  "install": "prebuild-install || node-gyp rebuild --release",
36
42
  "build-release": "node-gyp rebuild --release",
@@ -2,6 +2,21 @@
2
2
  //
3
3
 
4
4
  #include "better_sqlite3.hpp"
5
+ #line 39 "./src/util/binder.lzz"
6
+ static bool IsPlainObject(v8::Isolate* isolate, v8::Local<v8::Object> obj) {
7
+ v8::Local<v8::Value> proto = obj->GetPrototype();
8
+
9
+ #if defined NODE_MODULE_VERSION && NODE_MODULE_VERSION < 93
10
+ v8::Local<v8::Context> ctx = obj->CreationContext();
11
+ #else
12
+ v8::Local<v8::Context> ctx = obj->GetCreationContext().ToLocalChecked();
13
+ #endif
14
+
15
+ ctx->Enter();
16
+ v8::Local<v8::Value> baseProto = v8::Object::New(isolate)->GetPrototype();
17
+ ctx->Exit();
18
+ return proto->StrictEquals(baseProto) || proto->StrictEquals(v8::Null(isolate));
19
+ }
5
20
  #line 67 "./src/better_sqlite3.lzz"
6
21
  NODE_MODULE_INIT(/* exports, context */) {
7
22
  v8::Isolate* isolate = context->GetIsolate();
@@ -104,8 +119,7 @@ void SetPrototypeGetter (v8::Isolate * isolate, v8::Local <v8::External> data, v
104
119
  0,
105
120
  data,
106
121
  v8::AccessControl::DEFAULT,
107
- v8::PropertyAttribute::None,
108
- v8::AccessorSignature::New(isolate, recv)
122
+ v8::PropertyAttribute::None
109
123
  );
110
124
  }
111
125
  #line 4 "./src/util/constants.lzz"
@@ -1951,20 +1965,9 @@ bool Binder::Bind (v8::FunctionCallbackInfo <v8 :: Value> const & info, int argc
1951
1965
  }
1952
1966
  return success;
1953
1967
  }
1954
- #line 35 "./src/util/binder.lzz"
1955
- bool Binder::IsPlainObject (v8::Isolate * isolate, v8::Local <v8::Object> obj)
1956
- #line 35 "./src/util/binder.lzz"
1957
- {
1958
- v8::Local<v8::Value> proto = obj->GetPrototype();
1959
- v8::Local<v8::Context> ctx = obj->CreationContext();
1960
- ctx->Enter();
1961
- v8::Local<v8::Value> baseProto = v8::Object::New(isolate)->GetPrototype();
1962
- ctx->Exit();
1963
- return proto->StrictEquals(baseProto) || proto->StrictEquals(v8::Null(isolate));
1964
- }
1965
- #line 44 "./src/util/binder.lzz"
1968
+ #line 54 "./src/util/binder.lzz"
1966
1969
  void Binder::Fail (void (* Throw) (char const *), char const * message)
1967
- #line 44 "./src/util/binder.lzz"
1970
+ #line 54 "./src/util/binder.lzz"
1968
1971
  {
1969
1972
  assert(success == true);
1970
1973
  assert((Throw == NULL) == (message == NULL));
@@ -1972,16 +1975,16 @@ void Binder::Fail (void (* Throw) (char const *), char const * message)
1972
1975
  if (Throw) Throw(message);
1973
1976
  success = false;
1974
1977
  }
1975
- #line 52 "./src/util/binder.lzz"
1978
+ #line 62 "./src/util/binder.lzz"
1976
1979
  int Binder::NextAnonIndex ()
1977
- #line 52 "./src/util/binder.lzz"
1980
+ #line 62 "./src/util/binder.lzz"
1978
1981
  {
1979
1982
  while (sqlite3_bind_parameter_name(handle, ++anon_index) != NULL) {}
1980
1983
  return anon_index;
1981
1984
  }
1982
- #line 58 "./src/util/binder.lzz"
1985
+ #line 68 "./src/util/binder.lzz"
1983
1986
  void Binder::BindValue (v8::Isolate * isolate, v8::Local <v8::Value> value, int index)
1984
- #line 58 "./src/util/binder.lzz"
1987
+ #line 68 "./src/util/binder.lzz"
1985
1988
  {
1986
1989
  int status = Data::BindValueFromJS(isolate, handle, index, value);
1987
1990
  if (status != SQLITE_OK) {
@@ -2000,9 +2003,9 @@ void Binder::BindValue (v8::Isolate * isolate, v8::Local <v8::Value> value, int
2000
2003
  assert(false);
2001
2004
  }
2002
2005
  }
2003
- #line 79 "./src/util/binder.lzz"
2006
+ #line 89 "./src/util/binder.lzz"
2004
2007
  int Binder::BindArray (v8::Isolate * isolate, v8::Local <v8::Array> arr)
2005
- #line 79 "./src/util/binder.lzz"
2008
+ #line 89 "./src/util/binder.lzz"
2006
2009
  {
2007
2010
  v8 :: Local < v8 :: Context > ctx = isolate -> GetCurrentContext ( ) ;
2008
2011
  uint32_t length = arr->Length();
@@ -2024,9 +2027,9 @@ int Binder::BindArray (v8::Isolate * isolate, v8::Local <v8::Array> arr)
2024
2027
  }
2025
2028
  return len;
2026
2029
  }
2027
- #line 105 "./src/util/binder.lzz"
2030
+ #line 115 "./src/util/binder.lzz"
2028
2031
  int Binder::BindObject (v8::Isolate * isolate, v8::Local <v8::Object> obj, Statement * stmt)
2029
- #line 105 "./src/util/binder.lzz"
2032
+ #line 115 "./src/util/binder.lzz"
2030
2033
  {
2031
2034
  v8 :: Local < v8 :: Context > ctx = isolate -> GetCurrentContext ( ) ;
2032
2035
  BindMap* bind_map = stmt->GetBindMap(isolate);
@@ -2063,9 +2066,9 @@ int Binder::BindObject (v8::Isolate * isolate, v8::Local <v8::Object> obj, State
2063
2066
 
2064
2067
  return len;
2065
2068
  }
2066
- #line 149 "./src/util/binder.lzz"
2069
+ #line 159 "./src/util/binder.lzz"
2067
2070
  Binder::Result Binder::BindArgs (v8::FunctionCallbackInfo <v8 :: Value> const & info, int argc, Statement * stmt)
2068
- #line 149 "./src/util/binder.lzz"
2071
+ #line 159 "./src/util/binder.lzz"
2069
2072
  {
2070
2073
  v8 :: Isolate * isolate = info . GetIsolate ( ) ;
2071
2074
  int count = 0;
@@ -18,6 +18,8 @@
18
18
  #include <node_buffer.h>
19
19
  #line 31 "./src/util/macros.lzz"
20
20
  template <class T> using CopyablePersistent = v8::Persistent<T, v8::CopyablePersistentTraits<T>>;
21
+ #line 36 "./src/util/binder.lzz"
22
+ static bool IsPlainObject(v8::Isolate* isolate, v8::Local<v8::Object> obj);
21
23
  #define LZZ_INLINE inline
22
24
  #line 16 "./src/util/macros.lzz"
23
25
  v8::Local <v8::String> StringFromUtf8 (v8::Isolate * isolate, char const * data, int length);
@@ -752,27 +754,25 @@ private:
752
754
  #line 32 "./src/util/binder.lzz"
753
755
  bool bound_object;
754
756
  };
755
- #line 35 "./src/util/binder.lzz"
756
- static bool IsPlainObject (v8::Isolate * isolate, v8::Local <v8::Object> obj);
757
- #line 44 "./src/util/binder.lzz"
757
+ #line 54 "./src/util/binder.lzz"
758
758
  void Fail (void (* Throw) (char const *), char const * message);
759
- #line 52 "./src/util/binder.lzz"
759
+ #line 62 "./src/util/binder.lzz"
760
760
  int NextAnonIndex ();
761
- #line 58 "./src/util/binder.lzz"
761
+ #line 68 "./src/util/binder.lzz"
762
762
  void BindValue (v8::Isolate * isolate, v8::Local <v8::Value> value, int index);
763
- #line 79 "./src/util/binder.lzz"
763
+ #line 89 "./src/util/binder.lzz"
764
764
  int BindArray (v8::Isolate * isolate, v8::Local <v8::Array> arr);
765
- #line 105 "./src/util/binder.lzz"
765
+ #line 115 "./src/util/binder.lzz"
766
766
  int BindObject (v8::Isolate * isolate, v8::Local <v8::Object> obj, Statement * stmt);
767
- #line 149 "./src/util/binder.lzz"
767
+ #line 159 "./src/util/binder.lzz"
768
768
  Result BindArgs (v8::FunctionCallbackInfo <v8 :: Value> const & info, int argc, Statement * stmt);
769
- #line 189 "./src/util/binder.lzz"
769
+ #line 199 "./src/util/binder.lzz"
770
770
  sqlite3_stmt * handle;
771
- #line 190 "./src/util/binder.lzz"
771
+ #line 200 "./src/util/binder.lzz"
772
772
  int param_count;
773
- #line 191 "./src/util/binder.lzz"
773
+ #line 201 "./src/util/binder.lzz"
774
774
  int anon_index;
775
- #line 192 "./src/util/binder.lzz"
775
+ #line 202 "./src/util/binder.lzz"
776
776
  bool success;
777
777
  };
778
778
  #line 34 "./src/better_sqlite3.lzz"