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 "vm/unit_test.h" | 5 #include "vm/unit_test.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, | 139 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, |
140 Dart_Handle library, | 140 Dart_Handle library, |
141 Dart_Handle url) { | 141 Dart_Handle url) { |
142 if (tag == Dart_kScriptTag) { | 142 if (tag == Dart_kScriptTag) { |
143 // Reload request. | 143 // Reload request. |
144 ASSERT(script_reload_key != kUnsetThreadLocalKey); | 144 ASSERT(script_reload_key != kUnsetThreadLocalKey); |
145 const char* script_source = | 145 const char* script_source = |
146 reinterpret_cast<const char*>( | 146 reinterpret_cast<const char*>( |
147 OSThread::GetThreadLocal(script_reload_key)); | 147 OSThread::GetThreadLocal(script_reload_key)); |
148 ASSERT(script_source != NULL); | 148 ASSERT(script_source != NULL); |
149 OSThread::SetThreadLocal(script_reload_key, NULL); | 149 OSThread::SetThreadLocal(script_reload_key, 0); |
150 return Dart_LoadScript(url, | 150 return Dart_LoadScript(url, |
151 NewString(script_source), | 151 NewString(script_source), |
152 0, | 152 0, |
153 0); | 153 0); |
154 } | 154 } |
155 if (!Dart_IsLibrary(library)) { | 155 if (!Dart_IsLibrary(library)) { |
156 return Dart_NewApiError("not a library"); | 156 return Dart_NewApiError("not a library"); |
157 } | 157 } |
158 if (!Dart_IsString(url)) { | 158 if (!Dart_IsString(url)) { |
159 return Dart_NewApiError("url is not a string"); | 159 return Dart_NewApiError("url is not a string"); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 461 } |
462 // Copy the remainder of in to out. | 462 // Copy the remainder of in to out. |
463 while (*in != '\0') { | 463 while (*in != '\0') { |
464 *out++ = *in++; | 464 *out++ = *in++; |
465 } | 465 } |
466 *out = '\0'; | 466 *out = '\0'; |
467 } | 467 } |
468 | 468 |
469 | 469 |
470 } // namespace dart | 470 } // namespace dart |
OLD | NEW |