Index: runtime/vm/compiler_test.cc |
diff --git a/runtime/vm/compiler_test.cc b/runtime/vm/compiler_test.cc |
index f2e138cf0f06dc73bf69f101f1c5e2c8fa052ada..5225c53a9cc2fb7a42e752d40f12075fe0d3005c 100644 |
--- a/runtime/vm/compiler_test.cc |
+++ b/runtime/vm/compiler_test.cc |
@@ -22,9 +22,8 @@ VM_TEST_CASE(CompileScript) { |
"}\n"; |
String& url = String::Handle(String::New("dart-test:CompileScript")); |
String& source = String::Handle(String::New(kScriptChars)); |
- Script& script = Script::Handle(Script::New(url, |
- source, |
- RawScript::kScriptTag)); |
+ Script& script = |
+ Script::Handle(Script::New(url, source, RawScript::kScriptTag)); |
Library& lib = Library::Handle(Library::CoreLibrary()); |
EXPECT(CompilerTest::TestCompileScript(lib, script)); |
} |
@@ -32,22 +31,21 @@ VM_TEST_CASE(CompileScript) { |
VM_TEST_CASE(CompileFunction) { |
const char* kScriptChars = |
- "class A {\n" |
- " static foo() { return 42; }\n" |
- " static moo() {\n" |
- " // A.foo();\n" |
- " }\n" |
- "}\n"; |
+ "class A {\n" |
+ " static foo() { return 42; }\n" |
+ " static moo() {\n" |
+ " // A.foo();\n" |
+ " }\n" |
+ "}\n"; |
String& url = String::Handle(String::New("dart-test:CompileFunction")); |
String& source = String::Handle(String::New(kScriptChars)); |
- Script& script = Script::Handle(Script::New(url, |
- source, |
- RawScript::kScriptTag)); |
+ Script& script = |
+ Script::Handle(Script::New(url, source, RawScript::kScriptTag)); |
Library& lib = Library::Handle(Library::CoreLibrary()); |
EXPECT(CompilerTest::TestCompileScript(lib, script)); |
EXPECT(ClassFinalizer::ProcessPendingClasses()); |
- Class& cls = Class::Handle( |
- lib.LookupClass(String::Handle(Symbols::New(thread, "A")))); |
+ Class& cls = |
+ Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A")))); |
EXPECT(!cls.IsNull()); |
String& function_foo_name = String::Handle(String::New("foo")); |
Function& function_foo = |
@@ -74,20 +72,19 @@ VM_TEST_CASE(CompileFunction) { |
VM_TEST_CASE(CompileFunctionOnHelperThread) { |
// Create a simple function and compile it without optimization. |
const char* kScriptChars = |
- "class A {\n" |
- " static foo() { return 42; }\n" |
- "}\n"; |
+ "class A {\n" |
+ " static foo() { return 42; }\n" |
+ "}\n"; |
String& url = |
String::Handle(String::New("dart-test:CompileFunctionOnHelperThread")); |
String& source = String::Handle(String::New(kScriptChars)); |
- Script& script = Script::Handle(Script::New(url, |
- source, |
- RawScript::kScriptTag)); |
+ Script& script = |
+ Script::Handle(Script::New(url, source, RawScript::kScriptTag)); |
Library& lib = Library::Handle(Library::CoreLibrary()); |
EXPECT(CompilerTest::TestCompileScript(lib, script)); |
EXPECT(ClassFinalizer::ProcessPendingClasses()); |
- Class& cls = Class::Handle( |
- lib.LookupClass(String::Handle(Symbols::New(thread, "A")))); |
+ Class& cls = |
+ Class::Handle(lib.LookupClass(String::Handle(Symbols::New(thread, "A")))); |
EXPECT(!cls.IsNull()); |
String& function_foo_name = String::Handle(String::New("foo")); |
Function& func = |
@@ -115,13 +112,13 @@ VM_TEST_CASE(CompileFunctionOnHelperThread) { |
TEST_CASE(RegenerateAllocStubs) { |
const char* kScriptChars = |
- "class A {\n" |
- "}\n" |
- "unOpt() => new A(); \n" |
- "optIt() => new A(); \n" |
- "A main() {\n" |
- " return unOpt();\n" |
- "}\n"; |
+ "class A {\n" |
+ "}\n" |
+ "unOpt() => new A(); \n" |
+ "optIt() => new A(); \n" |
+ "A main() {\n" |
+ " return unOpt();\n" |
+ "}\n"; |
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |
Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); |
@@ -133,8 +130,8 @@ TEST_CASE(RegenerateAllocStubs) { |
EXPECT(!cls.IsNull()); |
Zone* zone = thread->zone(); |
- const Code& stub = Code::Handle(zone, |
- StubCode::GetAllocationStubForClass(cls)); |
+ const Code& stub = |
+ Code::Handle(zone, StubCode::GetAllocationStubForClass(cls)); |
Class& owner = Class::Handle(); |
owner ^= stub.owner(); |
owner.DisableAllocationStub(); |
@@ -163,7 +160,7 @@ TEST_CASE(EvalExpression) { |
Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |
Dart_Handle obj_handle = |
- Dart_Invoke(lib, Dart_NewStringFromCString("makeObj"), 0, NULL); |
+ Dart_Invoke(lib, Dart_NewStringFromCString("makeObj"), 0, NULL); |
EXPECT(!Dart_IsNull(obj_handle)); |
EXPECT(!Dart_IsError(obj_handle)); |
TransitionNativeToVM transition(thread); |
@@ -175,10 +172,8 @@ TEST_CASE(EvalExpression) { |
expr_text = String::New("apa + ' ${calc(10)}' + dot"); |
Object& val = Object::Handle(); |
const Class& receiver_cls = Class::Handle(obj.clazz()); |
- val = Instance::Cast(obj).Evaluate(receiver_cls, |
- expr_text, |
- Array::empty_array(), |
- Array::empty_array()); |
+ val = Instance::Cast(obj).Evaluate( |
+ receiver_cls, expr_text, Array::empty_array(), Array::empty_array()); |
EXPECT(!val.IsNull()); |
EXPECT(!val.IsError()); |
EXPECT(val.IsString()); |
@@ -189,8 +184,8 @@ TEST_CASE(EvalExpression) { |
VM_TEST_CASE(EvalExpressionWithLazyCompile) { |
Library& lib = Library::Handle(Library::CoreLibrary()); |
- const String& expression = String::Handle(String::New( |
- "(){ return (){ return (){ return 3 + 4; }(); }(); }()")); |
+ const String& expression = String::Handle( |
+ String::New("(){ return (){ return (){ return 3 + 4; }(); }(); }()")); |
Object& val = Object::Handle(); |
val = lib.Evaluate(expression, Array::empty_array(), Array::empty_array()); |