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 "bin/builtin.h" | 5 #include "bin/builtin.h" |
6 #include "vm/compiler.h" | 6 #include "vm/compiler.h" |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_mirrors_api.h" | 8 #include "include/dart_mirrors_api.h" |
9 #include "include/dart_native_api.h" | 9 #include "include/dart_native_api.h" |
10 #include "include/dart_tools_api.h" | 10 #include "include/dart_tools_api.h" |
(...skipping 6781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6792 EXPECT_VALID(result); | 6792 EXPECT_VALID(result); |
6793 | 6793 |
6794 const char* patchNames[] = { "main library patch", | 6794 const char* patchNames[] = { "main library patch", |
6795 "patch class only", | 6795 "patch class only", |
6796 "patch no class" }; | 6796 "patch no class" }; |
6797 const char* patches[] = { kPatchChars, | 6797 const char* patches[] = { kPatchChars, |
6798 kPatchClassOnlyChars, | 6798 kPatchClassOnlyChars, |
6799 kPatchNoClassChars }; | 6799 kPatchNoClassChars }; |
6800 const String& lib_url = String::Handle(String::New("theLibrary")); | 6800 const String& lib_url = String::Handle(String::New("theLibrary")); |
6801 | 6801 |
6802 const Library& lib = Library::Handle(Library::LookupLibrary(lib_url)); | 6802 const Library& lib = Library::Handle(Library::LookupLibrary(thread, lib_url)); |
6803 | 6803 |
6804 for (int i = 0; i < 3; i++) { | 6804 for (int i = 0; i < 3; i++) { |
6805 const String& patch_url = String::Handle(String::New(patchNames[i])); | 6805 const String& patch_url = String::Handle(String::New(patchNames[i])); |
6806 const String& patch_source = String::Handle(String::New(patches[i])); | 6806 const String& patch_source = String::Handle(String::New(patches[i])); |
6807 const Script& patch_script = Script::Handle(Script::New( | 6807 const Script& patch_script = Script::Handle(Script::New( |
6808 patch_url, patch_source, RawScript::kPatchTag)); | 6808 patch_url, patch_source, RawScript::kPatchTag)); |
6809 | 6809 |
6810 const Error& err = Error::Handle(lib.Patch(patch_script)); | 6810 const Error& err = Error::Handle(lib.Patch(patch_script)); |
6811 if (!err.IsNull()) { | 6811 if (!err.IsNull()) { |
6812 OS::Print("Patching error: %s\n", err.ToErrorCString()); | 6812 OS::Print("Patching error: %s\n", err.ToErrorCString()); |
(...skipping 3240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10053 result = Dart_Invoke(lib, | 10053 result = Dart_Invoke(lib, |
10054 NewString("foozoo"), | 10054 NewString("foozoo"), |
10055 0, | 10055 0, |
10056 NULL); | 10056 NULL); |
10057 EXPECT(Dart_IsError(result)); | 10057 EXPECT(Dart_IsError(result)); |
10058 } | 10058 } |
10059 | 10059 |
10060 #endif // !PRODUCT | 10060 #endif // !PRODUCT |
10061 | 10061 |
10062 } // namespace dart | 10062 } // namespace dart |
OLD | NEW |