diff --git a/src/node_sqlite.cc b/src/node_sqlite.cc index bc3c079850ae9b..f2d88293fcaad6 100644 --- a/src/node_sqlite.cc +++ b/src/node_sqlite.cc @@ -523,9 +523,9 @@ void StatementSync::IterateReturnCallback( auto context = env->context(); Local data = Local::Cast(args.Data()); - IterateCaptureContext* captureContext = + IterateCaptureContext* capture_context = static_cast(data->Value()); - auto stmt = captureContext->stmt; + auto stmt = capture_context->stmt; sqlite3_reset(stmt->statement_); Local result = Object::New(isolate); @@ -549,10 +549,10 @@ void StatementSync::IterateNextCallback( auto context = env->context(); Local data = Local::Cast(args.Data()); - IterateCaptureContext* captureContext = + IterateCaptureContext* capture_context = static_cast(data->Value()); - auto stmt = captureContext->stmt; - auto num_cols = captureContext->num_cols; + auto stmt = capture_context->stmt; + auto num_cols = capture_context->num_cols; int r = sqlite3_step(stmt->statement_); if (r != SQLITE_ROW) { @@ -616,45 +616,48 @@ void StatementSync::Iterate(const FunctionCallbackInfo& args) { return; } - Local iterableIteratorTemplate = ObjectTemplate::New(isolate); + Local iterable_iterator_template = + ObjectTemplate::New(isolate); - IterateCaptureContext* captureContext = new IterateCaptureContext(); - captureContext->num_cols = sqlite3_column_count(stmt->statement_); - captureContext->stmt = stmt; - Local nextFuncTemplate = + IterateCaptureContext* capture_context = new IterateCaptureContext(); + capture_context->num_cols = sqlite3_column_count(stmt->statement_); + capture_context->stmt = stmt; + Local next_func_template = FunctionTemplate::New(isolate, StatementSync::IterateNextCallback, - External::New(isolate, captureContext)); - Local returnFuncTemplate = + External::New(isolate, capture_context)); + Local return_func_template = FunctionTemplate::New(isolate, StatementSync::IterateReturnCallback, - External::New(isolate, captureContext)); + External::New(isolate, capture_context)); - iterableIteratorTemplate->Set(String::NewFromUtf8Literal(isolate, "next"), - nextFuncTemplate); - iterableIteratorTemplate->Set(String::NewFromUtf8Literal(isolate, "return"), - returnFuncTemplate); + iterable_iterator_template->Set(String::NewFromUtf8Literal(isolate, "next"), + next_func_template); + iterable_iterator_template->Set(String::NewFromUtf8Literal(isolate, "return"), + return_func_template); - Local iterableIterator = - iterableIteratorTemplate->NewInstance(context).ToLocalChecked(); + Local iterable_iterator = + iterable_iterator_template->NewInstance(context).ToLocalChecked(); Local global = context->Global(); - Local globalThis = + Local js_global_this = global->Get(context, String::NewFromUtf8Literal(isolate, "globalThis")) .ToLocalChecked() .As(); - Local JSIterator = - globalThis->Get(context, String::NewFromUtf8Literal(isolate, "Iterator")) + Local js_iterator = + js_global_this + ->Get(context, String::NewFromUtf8Literal(isolate, "Iterator")) .ToLocalChecked() .As(); - Local JSIteratorPrototype = - JSIterator->Get(context, String::NewFromUtf8Literal(isolate, "prototype")) + Local js_iterator_prototype = + js_iterator + ->Get(context, String::NewFromUtf8Literal(isolate, "prototype")) .ToLocalChecked() .As(); - iterableIterator->SetPrototype(context, JSIteratorPrototype).ToChecked(); + iterable_iterator->SetPrototype(context, js_iterator_prototype).ToChecked(); - args.GetReturnValue().Set(iterableIterator); + args.GetReturnValue().Set(iterable_iterator); } void StatementSync::Get(const FunctionCallbackInfo& args) {