@@ -68,7 +68,10 @@ using v8::Value;
6868 } \
6969 } while (0 )
7070
71- #define SQLITE_VALUE_TO_JS (from, isolate, use_big_int_args, use_null_as_undefined_, result, ...) \
71+ #define SQLITE_VALUE_TO_JS (from, isolate, \
72+ use_big_int_args, \
73+ use_null_as_undefined_, \
74+ result, ...) \
7275 do { \
7376 switch (sqlite3_##from##_type (__VA_ARGS__)) { \
7477 case SQLITE_INTEGER: { \
@@ -317,7 +320,12 @@ class CustomAggregate {
317320 for (int i = 0 ; i < argc; ++i) {
318321 sqlite3_value* value = argv[i];
319322 MaybeLocal<Value> js_val;
320- SQLITE_VALUE_TO_JS (value, isolate, self->use_bigint_args_ , self->use_null_as_undefined_args_ , js_val, value);
323+ SQLITE_VALUE_TO_JS (value,
324+ isolate,
325+ self->use_bigint_args_ ,
326+ self->use_null_as_undefined_args_ ,
327+ js_val,
328+ value);
321329 if (js_val.IsEmpty ()) {
322330 // Ignore the SQLite error because a JavaScript exception is pending.
323331 self->db_ ->SetIgnoreNextSQLiteError (true );
@@ -624,7 +632,12 @@ void UserDefinedFunction::xFunc(sqlite3_context* ctx,
624632 for (int i = 0 ; i < argc; ++i) {
625633 sqlite3_value* value = argv[i];
626634 MaybeLocal<Value> js_val = MaybeLocal<Value>();
627- SQLITE_VALUE_TO_JS (value, isolate, self->use_bigint_args_ , self->use_null_as_undefined_args_ , js_val, value);
635+ SQLITE_VALUE_TO_JS (value,
636+ isolate,
637+ self->use_bigint_args_ ,
638+ self->use_null_as_undefined_args_ ,
639+ js_val,
640+ value);
628641 if (js_val.IsEmpty ()) {
629642 // Ignore the SQLite error because a JavaScript exception is pending.
630643 self->db_ ->SetIgnoreNextSQLiteError (true );
@@ -1002,7 +1015,8 @@ void DatabaseSync::New(const FunctionCallbackInfo<Value>& args) {
10021015 R"( The "options.readNullAsUndefined" argument must be a boolean.)" );
10031016 return ;
10041017 }
1005- open_config.set_use_null_as_undefined (read_null_as_undefined_v.As <Boolean>()->Value ());
1018+ open_config.set_use_null_as_undefined (read_null_as_undefined_v
1019+ .As <Boolean>()->Value ());
10061020 }
10071021 }
10081022
@@ -1260,7 +1274,11 @@ void DatabaseSync::CustomFunction(const FunctionCallbackInfo<Value>& args) {
12601274 }
12611275
12621276 UserDefinedFunction* user_data =
1263- new UserDefinedFunction (env, fn, db, use_bigint_args, use_null_as_undefined_args);
1277+ new UserDefinedFunction (env,
1278+ fn,
1279+ db,
1280+ use_bigint_args,
1281+ use_null_as_undefined_args);
12641282 int text_rep = SQLITE_UTF8;
12651283
12661284 if (deterministic) {
@@ -1474,14 +1492,15 @@ void DatabaseSync::AggregateFunction(const FunctionCallbackInfo<Value>& args) {
14741492 *name,
14751493 argc,
14761494 text_rep,
1477- new CustomAggregate (env,
1478- db,
1479- use_bigint_args,
1480- use_null_as_undefined_args,
1481- start_v,
1482- stepFunction,
1483- inverseFunc,
1484- resultFunction),
1495+ new CustomAggregate (
1496+ env,
1497+ db,
1498+ use_bigint_args,
1499+ use_null_as_undefined_args,
1500+ start_v,
1501+ stepFunction,
1502+ inverseFunc,
1503+ resultFunction),
14851504 CustomAggregate::xStep,
14861505 CustomAggregate::xFinal,
14871506 xValue,
@@ -2045,8 +2064,13 @@ bool StatementSync::BindValue(const Local<Value>& value, const int index) {
20452064MaybeLocal<Value> StatementSync::ColumnToValue (const int column) {
20462065 Isolate* isolate = env ()->isolate ();
20472066 MaybeLocal<Value> js_val = MaybeLocal<Value>();
2048- SQLITE_VALUE_TO_JS (
2049- column, isolate, use_big_ints_, use_null_as_undefined_, js_val, statement_, column);
2067+ SQLITE_VALUE_TO_JS (column,
2068+ isolate,
2069+ use_big_ints_,
2070+ use_null_as_undefined_,
2071+ js_val,
2072+ statement_,
2073+ column);
20502074 return js_val;
20512075}
20522076
@@ -2424,7 +2448,8 @@ void StatementSync::SetReadBigInts(const FunctionCallbackInfo<Value>& args) {
24242448 stmt->use_big_ints_ = args[0 ]->IsTrue ();
24252449}
24262450
2427- void StatementSync::SetReadNullAsUndefined (const FunctionCallbackInfo<Value>& args) {
2451+ void StatementSync::SetReadNullAsUndefined (
2452+ const FunctionCallbackInfo<Value>& args) {
24282453 StatementSync* stmt;
24292454 ASSIGN_OR_RETURN_UNWRAP (&stmt, args.This ());
24302455 Environment* env = Environment::GetCurrent (args);
@@ -2433,11 +2458,12 @@ void StatementSync::SetReadNullAsUndefined(const FunctionCallbackInfo<Value>& ar
24332458
24342459 if (!args[0 ]->IsBoolean ()) {
24352460 THROW_ERR_INVALID_ARG_TYPE (
2436- env->isolate (), " The \" readNullAsUndefined\" argument must be a boolean." );
2461+ env->isolate (),
2462+ " The \" readNullAsUndefined\" argument must be a boolean." );
24372463 return ;
24382464 }
24392465
2440- stmt->use_null_as_undefined_ = args[0 ]->IsTrue ();
2466+ stmt->use_null_as_undefined_ = args[0 ]->IsTrue ();
24412467}
24422468
24432469void StatementSync::SetReturnArrays (const FunctionCallbackInfo<Value>& args) {
@@ -2510,7 +2536,8 @@ Local<FunctionTemplate> StatementSync::GetConstructorTemplate(
25102536 " setAllowUnknownNamedParameters" ,
25112537 StatementSync::SetAllowUnknownNamedParameters);
25122538 SetProtoMethod (
2513- isolate, tmpl, " setReadNullAsUndefined" , StatementSync::SetReadNullAsUndefined);
2539+ isolate, tmpl, " setReadNullAsUndefined" ,
2540+ StatementSync::SetReadNullAsUndefined);
25142541 SetProtoMethod (
25152542 isolate, tmpl, " setReadBigInts" , StatementSync::SetReadBigInts);
25162543 SetProtoMethod (
0 commit comments