Skip to content

Commit 8f0bc1f

Browse files
committed
core, refactor: format JavaScript code.
1 parent 3f895d2 commit 8f0bc1f

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

fibjs/src/base/Runtime.cpp

+22-23
Original file line numberDiff line numberDiff line change
@@ -177,29 +177,28 @@ void Isolate::init()
177177
m_topSandbox = new SandBox();
178178
m_topSandbox->initRoot();
179179

180-
auto assertion_error =
181-
"class AssertionError extends Error {"
182-
"constructor(options) {"
183-
"var { actual, expected, message, operator } = options;"
184-
"if (message) {"
185-
"super(message);"
186-
"} else {"
187-
"if (actual && actual.stack && actual instanceof Error)"
188-
"actual = `${actual.name}: ${actual.message}`;"
189-
"if (expected && expected.stack && expected instanceof Error)"
190-
"expected = `${expected.name}: ${expected.message}`;"
191-
"super(`${JSON.stringify(actual).slice(0, 128)} ` +"
192-
"`${operator} ${JSON.stringify(expected).slice(0, 128)}`);"
193-
"}"
194-
"this.generatedMessage = !message;"
195-
"this.name = 'AssertionError [ERR_ASSERTION]';"
196-
"this.code = 'ERR_ASSERTION';"
197-
"this.actual = actual;"
198-
"this.expected = expected;"
199-
"this.operator = operator;"
200-
"}"
201-
"}"
202-
"AssertionError;";
180+
auto assertion_error = "class AssertionError extends Error {"
181+
" constructor(options) {"
182+
" var { actual, expected, message, operator } = options;"
183+
" if (message) {"
184+
" super(message);"
185+
" } else {"
186+
" if (actual && actual.stack && actual instanceof Error)"
187+
" actual = `${actual.name}: ${actual.message}`;"
188+
" if (expected && expected.stack && expected instanceof Error)"
189+
" expected = `${expected.name}: ${expected.message}`;"
190+
" super(`${JSON.stringify(actual).slice(0, 128)} ` +"
191+
" `${operator} ${JSON.stringify(expected).slice(0, 128)}`);"
192+
" }"
193+
" this.generatedMessage = !message;"
194+
" this.name = 'AssertionError [ERR_ASSERTION]';"
195+
" this.code = 'ERR_ASSERTION';"
196+
" this.actual = actual;"
197+
" this.expected = expected;"
198+
" this.operator = operator;"
199+
" }"
200+
"}"
201+
"AssertionError;";
203202

204203
v8::Local<v8::Script> script = v8::Script::Compile(NewString(assertion_error));
205204
v8::Local<v8::Object> AssertionError = script->Run().As<v8::Object>();

0 commit comments

Comments
 (0)