Skip to content

Commit fc82998

Browse files
committed
chore: switch to snake_case
Refs: nodejs#54213 (comment)
1 parent 26b7ac1 commit fc82998

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

src/node_sqlite.cc

+29-26
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,9 @@ void StatementSync::IterateReturnCallback(
523523
auto context = env->context();
524524

525525
Local<External> data = Local<External>::Cast(args.Data());
526-
IterateCaptureContext* captureContext =
526+
IterateCaptureContext* capture_context =
527527
static_cast<IterateCaptureContext*>(data->Value());
528-
auto stmt = captureContext->stmt;
528+
auto stmt = capture_context->stmt;
529529
sqlite3_reset(stmt->statement_);
530530

531531
Local<Object> result = Object::New(isolate);
@@ -549,10 +549,10 @@ void StatementSync::IterateNextCallback(
549549
auto context = env->context();
550550

551551
Local<External> data = Local<External>::Cast(args.Data());
552-
IterateCaptureContext* captureContext =
552+
IterateCaptureContext* capture_context =
553553
static_cast<IterateCaptureContext*>(data->Value());
554-
auto stmt = captureContext->stmt;
555-
auto num_cols = captureContext->num_cols;
554+
auto stmt = capture_context->stmt;
555+
auto num_cols = capture_context->num_cols;
556556

557557
int r = sqlite3_step(stmt->statement_);
558558
if (r != SQLITE_ROW) {
@@ -616,45 +616,48 @@ void StatementSync::Iterate(const FunctionCallbackInfo<Value>& args) {
616616
return;
617617
}
618618

619-
Local<ObjectTemplate> iterableIteratorTemplate = ObjectTemplate::New(isolate);
619+
Local<ObjectTemplate> iterable_iterator_template =
620+
ObjectTemplate::New(isolate);
620621

621-
IterateCaptureContext* captureContext = new IterateCaptureContext();
622-
captureContext->num_cols = sqlite3_column_count(stmt->statement_);
623-
captureContext->stmt = stmt;
624-
Local<FunctionTemplate> nextFuncTemplate =
622+
IterateCaptureContext* capture_context = new IterateCaptureContext();
623+
capture_context->num_cols = sqlite3_column_count(stmt->statement_);
624+
capture_context->stmt = stmt;
625+
Local<FunctionTemplate> next_func_template =
625626
FunctionTemplate::New(isolate,
626627
StatementSync::IterateNextCallback,
627-
External::New(isolate, captureContext));
628-
Local<FunctionTemplate> returnFuncTemplate =
628+
External::New(isolate, capture_context));
629+
Local<FunctionTemplate> return_func_template =
629630
FunctionTemplate::New(isolate,
630631
StatementSync::IterateReturnCallback,
631-
External::New(isolate, captureContext));
632+
External::New(isolate, capture_context));
632633

633-
iterableIteratorTemplate->Set(String::NewFromUtf8Literal(isolate, "next"),
634-
nextFuncTemplate);
635-
iterableIteratorTemplate->Set(String::NewFromUtf8Literal(isolate, "return"),
636-
returnFuncTemplate);
634+
iterable_iterator_template->Set(String::NewFromUtf8Literal(isolate, "next"),
635+
next_func_template);
636+
iterable_iterator_template->Set(String::NewFromUtf8Literal(isolate, "return"),
637+
return_func_template);
637638

638-
Local<Object> iterableIterator =
639-
iterableIteratorTemplate->NewInstance(context).ToLocalChecked();
639+
Local<Object> iterable_iterator =
640+
iterable_iterator_template->NewInstance(context).ToLocalChecked();
640641

641642
Local<Object> global = context->Global();
642-
Local<Object> globalThis =
643+
Local<Object> js_global_this =
643644
global->Get(context, String::NewFromUtf8Literal(isolate, "globalThis"))
644645
.ToLocalChecked()
645646
.As<Object>();
646-
Local<Object> JSIterator =
647-
globalThis->Get(context, String::NewFromUtf8Literal(isolate, "Iterator"))
647+
Local<Object> js_iterator =
648+
js_global_this
649+
->Get(context, String::NewFromUtf8Literal(isolate, "Iterator"))
648650
.ToLocalChecked()
649651
.As<Object>();
650-
Local<Object> JSIteratorPrototype =
651-
JSIterator->Get(context, String::NewFromUtf8Literal(isolate, "prototype"))
652+
Local<Object> js_iterator_prototype =
653+
js_iterator
654+
->Get(context, String::NewFromUtf8Literal(isolate, "prototype"))
652655
.ToLocalChecked()
653656
.As<Object>();
654657

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

657-
args.GetReturnValue().Set(iterableIterator);
660+
args.GetReturnValue().Set(iterable_iterator);
658661
}
659662

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

0 commit comments

Comments
 (0)