Skip to content

Commit 645c22b

Browse files
committed
Formatting
1 parent 7631fa5 commit 645c22b

File tree

1 file changed

+36
-35
lines changed

1 file changed

+36
-35
lines changed

py_mini_racer/extension/mini_racer_extension.cc

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -275,30 +275,30 @@ static void* nogvl_context_eval(void* arg) {
275275
if (trycatch.HasCaught()) {
276276
if (!trycatch.Exception()->IsNull()) {
277277
result->message = new Persistent<Value>();
278-
Local<Message> message = trycatch.Message();
279-
char buf[1000];
280-
int len, line, column;
281-
282-
if (!message->GetLineNumber(context).To(&line)) {
283-
line = 0;
284-
}
285-
286-
if (!message->GetStartColumn(context).To(&column)) {
287-
column = 0;
288-
}
289-
290-
len = snprintf(buf, sizeof(buf), "%s at %s:%i:%i", *String::Utf8Value(isolate, message->Get()),
291-
*String::Utf8Value(isolate, message->GetScriptResourceName()->ToString(context).ToLocalChecked()),
292-
line,
293-
column);
294-
295-
if ((size_t) len >= sizeof(buf)) {
296-
len = sizeof(buf) - 1;
297-
buf[len] = '\0';
298-
}
299-
300-
Local<String> v8_message = String::NewFromUtf8(isolate, buf, NewStringType::kNormal, len).ToLocalChecked();
301-
result->message->Reset(isolate, v8_message);
278+
Local<Message> message = trycatch.Message();
279+
char buf[1000];
280+
int len, line, column;
281+
282+
if (!message->GetLineNumber(context).To(&line)) {
283+
line = 0;
284+
}
285+
286+
if (!message->GetStartColumn(context).To(&column)) {
287+
column = 0;
288+
}
289+
290+
len = snprintf(buf, sizeof(buf), "%s at %s:%i:%i", *String::Utf8Value(isolate, message->Get()),
291+
*String::Utf8Value(isolate, message->GetScriptResourceName()->ToString(context).ToLocalChecked()),
292+
line,
293+
column);
294+
295+
if ((size_t) len >= sizeof(buf)) {
296+
len = sizeof(buf) - 1;
297+
buf[len] = '\0';
298+
}
299+
300+
Local<String> v8_message = String::NewFromUtf8(isolate, buf, NewStringType::kNormal, len).ToLocalChecked();
301+
result->message->Reset(isolate, v8_message);
302302
} else if(trycatch.HasTerminated()) {
303303
result->terminated = true;
304304
result->message = new Persistent<Value>();
@@ -312,6 +312,7 @@ static void* nogvl_context_eval(void* arg) {
312312
}
313313

314314
if (!trycatch.StackTrace(context).IsEmpty()) {
315+
315316
result->backtrace = new Persistent<Value>();
316317
result->backtrace->Reset(isolate, trycatch.StackTrace(context).ToLocalChecked()->ToString(context).ToLocalChecked());
317318
}
@@ -387,7 +388,7 @@ static BinaryValue *heap_stats(ContextInfo *context_info) {
387388
content[idx++ * 2 + 1] = new_bv_int(0);
388389
content[idx++ * 2 + 1] = new_bv_int(0);
389390
} else {
390-
isolate->GetHeapStatistics(&stats);
391+
isolate->GetHeapStatistics(&stats);
391392

392393
content[idx++ * 2 + 1] = new_bv_int(stats.total_physical_size());
393394
content[idx++ * 2 + 1] = new_bv_int(stats.total_heap_size_executable());
@@ -415,7 +416,7 @@ static BinaryValue *heap_stats(ContextInfo *context_info) {
415416

416417

417418
static BinaryValue *convert_basic_v8_to_binary(Isolate * isolate,
418-
Local<Context> context,
419+
Local<Context> context,
419420
Local<Value> value)
420421
{
421422
Isolate::Scope isolate_scope(isolate);
@@ -528,9 +529,9 @@ static BinaryValue *convert_v8_to_binary(Isolate * isolate,
528529

529530
MaybeLocal<Value> maybe_pkey = props->Get(context, i);
530531
if (maybe_pkey.IsEmpty()) {
531-
goto err;
532-
}
533-
Local<Value> pkey = maybe_pkey.ToLocalChecked();
532+
goto err;
533+
}
534+
Local<Value> pkey = maybe_pkey.ToLocalChecked();
534535
MaybeLocal<Value> maybe_pvalue = object->Get(context, pkey);
535536
// this may have failed due to Get raising
536537
if (maybe_pvalue.IsEmpty() || trycatch.HasCaught()) {
@@ -575,7 +576,7 @@ static BinaryValue *convert_basic_v8_to_binary(Isolate * isolate,
575576
}
576577

577578
static BinaryValue *convert_v8_to_binary(Isolate * isolate,
578-
const Persistent<Context> & context,
579+
const Persistent<Context> & context,
579580
Local<Value> value)
580581
{
581582
HandleScope scope(isolate);
@@ -686,9 +687,9 @@ static BinaryValue* MiniRacer_eval_context_unsafe(
686687

687688
if (eval_params.basic_only) {
688689
bmessage = convert_basic_v8_to_binary(context_info->isolate, *context_info->context, tmp);
689-
} else {
690+
} else {
690691
bmessage = convert_v8_to_binary(context_info->isolate, *context_info->context, tmp);
691-
}
692+
}
692693
}
693694

694695
if (eval_result.backtrace) {
@@ -764,11 +765,11 @@ static BinaryValue* MiniRacer_eval_context_unsafe(
764765
HandleScope handle_scope(context_info->isolate);
765766

766767
Local<Value> tmp = Local<Value>::New(context_info->isolate, *eval_result.value);
767-
if (eval_params.basic_only) {
768+
if (eval_params.basic_only) {
768769
result = convert_basic_v8_to_binary(context_info->isolate, *context_info->context, tmp);
769-
} else {
770+
} else {
770771
result = convert_v8_to_binary(context_info->isolate, *context_info->context, tmp);
771-
}
772+
}
772773
}
773774

774775
BinaryValueFree(bmessage);

0 commit comments

Comments
 (0)