Skip to content

Commit a413954

Browse files
committed
chore: switch to snake_case
Refs: #54213 (comment)
1 parent f4d7b80 commit a413954

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

src/node_sqlite.cc

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,9 @@ void StatementSync::IterateReturnCallback(
520520
auto context = env->context();
521521

522522
Local<External> data = Local<External>::Cast(args.Data());
523-
IterateCaptureContext* captureContext =
523+
IterateCaptureContext* capture_context =
524524
static_cast<IterateCaptureContext*>(data->Value());
525-
auto stmt = captureContext->stmt;
525+
auto stmt = capture_context->stmt;
526526
sqlite3_reset(stmt->statement_);
527527

528528
Local<Object> result = Object::New(isolate);
@@ -546,10 +546,10 @@ void StatementSync::IterateNextCallback(
546546
auto context = env->context();
547547

548548
Local<External> data = Local<External>::Cast(args.Data());
549-
IterateCaptureContext* captureContext =
549+
IterateCaptureContext* capture_context =
550550
static_cast<IterateCaptureContext*>(data->Value());
551-
auto stmt = captureContext->stmt;
552-
auto num_cols = captureContext->num_cols;
551+
auto stmt = capture_context->stmt;
552+
auto num_cols = capture_context->num_cols;
553553

554554
int r = sqlite3_step(stmt->statement_);
555555
if (r != SQLITE_ROW) {
@@ -613,45 +613,48 @@ void StatementSync::Iterate(const FunctionCallbackInfo<Value>& args) {
613613
return;
614614
}
615615

616-
Local<ObjectTemplate> iterableIteratorTemplate = ObjectTemplate::New(isolate);
616+
Local<ObjectTemplate> iterable_iterator_template =
617+
ObjectTemplate::New(isolate);
617618

618-
IterateCaptureContext* captureContext = new IterateCaptureContext();
619-
captureContext->num_cols = sqlite3_column_count(stmt->statement_);
620-
captureContext->stmt = stmt;
621-
Local<FunctionTemplate> nextFuncTemplate =
619+
IterateCaptureContext* capture_context = new IterateCaptureContext();
620+
capture_context->num_cols = sqlite3_column_count(stmt->statement_);
621+
capture_context->stmt = stmt;
622+
Local<FunctionTemplate> next_func_template =
622623
FunctionTemplate::New(isolate,
623624
StatementSync::IterateNextCallback,
624-
External::New(isolate, captureContext));
625-
Local<FunctionTemplate> returnFuncTemplate =
625+
External::New(isolate, capture_context));
626+
Local<FunctionTemplate> return_func_template =
626627
FunctionTemplate::New(isolate,
627628
StatementSync::IterateReturnCallback,
628-
External::New(isolate, captureContext));
629+
External::New(isolate, capture_context));
629630

630-
iterableIteratorTemplate->Set(String::NewFromUtf8Literal(isolate, "next"),
631-
nextFuncTemplate);
632-
iterableIteratorTemplate->Set(String::NewFromUtf8Literal(isolate, "return"),
633-
returnFuncTemplate);
631+
iterable_iterator_template->Set(String::NewFromUtf8Literal(isolate, "next"),
632+
next_func_template);
633+
iterable_iterator_template->Set(String::NewFromUtf8Literal(isolate, "return"),
634+
return_func_template);
634635

635-
Local<Object> iterableIterator =
636-
iterableIteratorTemplate->NewInstance(context).ToLocalChecked();
636+
Local<Object> iterable_iterator =
637+
iterable_iterator_template->NewInstance(context).ToLocalChecked();
637638

638639
Local<Object> global = context->Global();
639-
Local<Object> globalThis =
640+
Local<Object> js_global_this =
640641
global->Get(context, String::NewFromUtf8Literal(isolate, "globalThis"))
641642
.ToLocalChecked()
642643
.As<Object>();
643-
Local<Object> JSIterator =
644-
globalThis->Get(context, String::NewFromUtf8Literal(isolate, "Iterator"))
644+
Local<Object> js_iterator =
645+
js_global_this
646+
->Get(context, String::NewFromUtf8Literal(isolate, "Iterator"))
645647
.ToLocalChecked()
646648
.As<Object>();
647-
Local<Object> JSIteratorPrototype =
648-
JSIterator->Get(context, String::NewFromUtf8Literal(isolate, "prototype"))
649+
Local<Object> js_iterator_prototype =
650+
js_iterator
651+
->Get(context, String::NewFromUtf8Literal(isolate, "prototype"))
649652
.ToLocalChecked()
650653
.As<Object>();
651654

652-
iterableIterator->SetPrototype(context, JSIteratorPrototype).ToChecked();
655+
iterable_iterator->SetPrototype(context, js_iterator_prototype).ToChecked();
653656

654-
args.GetReturnValue().Set(iterableIterator);
657+
args.GetReturnValue().Set(iterable_iterator);
655658
}
656659

657660
void StatementSync::Get(const FunctionCallbackInfo<Value>& args) {

0 commit comments

Comments
 (0)