Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/class_finalizer.h" | 6 #include "vm/class_finalizer.h" |
| 7 #include "vm/compiler.h" | 7 #include "vm/compiler.h" |
| 8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 " }\n" | 36 " }\n" |
| 37 "}\n"; | 37 "}\n"; |
| 38 String& url = String::Handle(String::New("dart-test:CompileFunction")); | 38 String& url = String::Handle(String::New("dart-test:CompileFunction")); |
| 39 String& source = String::Handle(String::New(kScriptChars)); | 39 String& source = String::Handle(String::New(kScriptChars)); |
| 40 Script& script = Script::Handle(Script::New(url, | 40 Script& script = Script::Handle(Script::New(url, |
| 41 source, | 41 source, |
| 42 RawScript::kScriptTag)); | 42 RawScript::kScriptTag)); |
| 43 Library& lib = Library::Handle(Library::CoreLibrary()); | 43 Library& lib = Library::Handle(Library::CoreLibrary()); |
| 44 EXPECT(CompilerTest::TestCompileScript(lib, script)); | 44 EXPECT(CompilerTest::TestCompileScript(lib, script)); |
| 45 EXPECT(ClassFinalizer::FinalizePendingClasses()); | 45 EXPECT(ClassFinalizer::FinalizePendingClasses()); |
| 46 String& ambiguity_error_msg = String::Handle(); | |
| 47 Class& cls = Class::Handle( | 46 Class& cls = Class::Handle( |
| 48 lib.LookupClass(String::Handle(Symbols::New("A")), &ambiguity_error_msg)); | 47 lib.LookupClass(String::Handle(Symbols::New("A")))); |
| 49 EXPECT(!cls.IsNull()); // No ambiguity error expected. | 48 EXPECT(!cls.IsNull()); // No ambiguity error expected. |
|
regis
2013/09/09 21:29:07
ditto
hausner
2013/09/09 21:52:08
Done.
| |
| 50 String& function_foo_name = String::Handle(String::New("foo")); | 49 String& function_foo_name = String::Handle(String::New("foo")); |
| 51 Function& function_foo = | 50 Function& function_foo = |
| 52 Function::Handle(cls.LookupStaticFunction(function_foo_name)); | 51 Function::Handle(cls.LookupStaticFunction(function_foo_name)); |
| 53 EXPECT(!function_foo.IsNull()); | 52 EXPECT(!function_foo.IsNull()); |
| 54 | 53 |
| 55 EXPECT(CompilerTest::TestCompileFunction(function_foo)); | 54 EXPECT(CompilerTest::TestCompileFunction(function_foo)); |
| 56 EXPECT(function_foo.HasCode()); | 55 EXPECT(function_foo.HasCode()); |
| 57 | 56 |
| 58 String& function_moo_name = String::Handle(String::New("moo")); | 57 String& function_moo_name = String::Handle(String::New("moo")); |
| 59 Function& function_moo = | 58 Function& function_moo = |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 88 expr_text = String::New("apa + ' ${calc(10)}' + dot"); | 87 expr_text = String::New("apa + ' ${calc(10)}' + dot"); |
| 89 Object& val = Object::Handle(); | 88 Object& val = Object::Handle(); |
| 90 val = Instance::Cast(obj).Evaluate(expr_text); | 89 val = Instance::Cast(obj).Evaluate(expr_text); |
| 91 EXPECT(!val.IsNull()); | 90 EXPECT(!val.IsNull()); |
| 92 EXPECT(!val.IsError()); | 91 EXPECT(!val.IsError()); |
| 93 EXPECT(val.IsString()); | 92 EXPECT(val.IsString()); |
| 94 EXPECT_STREQ("Herr Nilsson 100.", val.ToCString()); | 93 EXPECT_STREQ("Herr Nilsson 100.", val.ToCString()); |
| 95 } | 94 } |
| 96 | 95 |
| 97 } // namespace dart | 96 } // namespace dart |
| OLD | NEW |