@@ -138,8 +138,8 @@ void V8ShellFeature::stop() {
138
138
v8::Locker locker{_isolate};
139
139
v8::Isolate::Scope isolate_scope{_isolate};
140
140
141
- TRI_v8_global_t* v8g = \
142
- static_cast <TRI_v8_global_t*>(_isolate->GetData (V8DataSlot));
141
+ TRI_v8_global_t* v8g =
142
+ static_cast <TRI_v8_global_t*>(_isolate->GetData (V8DataSlot));
143
143
_isolate->SetData (V8DataSlot, nullptr );
144
144
145
145
delete v8g;
@@ -246,8 +246,7 @@ V8ClientConnection* V8ShellFeature::setup(
246
246
v8connection = std::make_unique<V8ClientConnection>(
247
247
connection, client->databaseName (), client->username (),
248
248
client->password (), client->requestTimeout ());
249
- }
250
- else {
249
+ } else {
251
250
client = nullptr ;
252
251
}
253
252
}
@@ -285,8 +284,10 @@ int V8ShellFeature::runShell(std::vector<std::string> const& positionals) {
285
284
286
285
V8LineEditor v8LineEditor (_isolate, context, " ." + _name + " .history" );
287
286
288
- v8LineEditor.setSignalFunction (
289
- [&v8connection]() { v8connection->setInterrupted (true ); });
287
+ if (v8connection != nullptr ) {
288
+ v8LineEditor.setSignalFunction (
289
+ [&v8connection]() { v8connection->setInterrupted (true ); });
290
+ }
290
291
291
292
v8LineEditor.open (_console->autoComplete ());
292
293
@@ -372,7 +373,9 @@ int V8ShellFeature::runShell(std::vector<std::string> const& positionals) {
372
373
promptError = true ;
373
374
}
374
375
375
- v8connection->setInterrupted (false );
376
+ if (v8connection != nullptr ) {
377
+ v8connection->setInterrupted (false );
378
+ }
376
379
377
380
_console->stopPager ();
378
381
_console->printLine (" " );
@@ -566,7 +569,7 @@ bool V8ShellFeature::jslint(std::vector<std::string> const& files) {
566
569
TRI_ExecuteJavaScriptString (_isolate, context, input, name, true );
567
570
568
571
if (tryCatch.HasCaught ()) {
569
- LOG (ERR) << TRI_StringifyV8Exception (_isolate, &tryCatch);
572
+ LOG (ERR) << TRI_StringifyV8Exception (_isolate, &tryCatch);
570
573
ok = false ;
571
574
} else {
572
575
bool res = TRI_ObjectToBoolean (context->Global ()->Get (
@@ -855,8 +858,7 @@ void V8ShellFeature::initMode(ShellFeature::RunMode runMode,
855
858
856
859
TRI_AddGlobalVariableVocbase (
857
860
_isolate, context, TRI_V8_ASCII_STRING2 (_isolate, " IS_UNIT_TESTS" ),
858
- v8::Boolean::New (_isolate,
859
- runMode == ShellFeature::RunMode::UNIT_TESTS));
861
+ v8::Boolean::New (_isolate, runMode == ShellFeature::RunMode::UNIT_TESTS));
860
862
861
863
TRI_AddGlobalVariableVocbase (
862
864
_isolate, context, TRI_V8_ASCII_STRING2 (_isolate, " IS_JS_LINT" ),
0 commit comments