| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Handle dart scripts. | 5 // Handle dart scripts. |
| 6 | 6 |
| 7 #include <assert.h> | |
| 8 #include <stdlib.h> | 7 #include <stdlib.h> |
| 9 #include <string.h> | 8 #include <string.h> |
| 10 #include <stdio.h> | 9 #include <stdio.h> |
| 11 | 10 |
| 12 #include "include/dart_api.h" | 11 #include "include/dart_api.h" |
| 13 | 12 |
| 14 #include "bin/builtin.h" | 13 #include "bin/builtin.h" |
| 15 #include "bin/file.h" | 14 #include "bin/file.h" |
| 16 #include "bin/globals.h" | 15 #include "bin/globals.h" |
| 17 #include "bin/process_script.h" | 16 #include "bin/process_script.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 Dart_Result LoadScript(const char* script_name) { | 148 Dart_Result LoadScript(const char* script_name) { |
| 150 Dart_Result result = ReadStringFromFile(script_name); | 149 Dart_Result result = ReadStringFromFile(script_name); |
| 151 if (!Dart_IsValidResult(result)) { | 150 if (!Dart_IsValidResult(result)) { |
| 152 return result; | 151 return result; |
| 153 } | 152 } |
| 154 Dart_Handle source = Dart_GetResult(result); | 153 Dart_Handle source = Dart_GetResult(result); |
| 155 Dart_Handle url = Dart_NewString(script_name); | 154 Dart_Handle url = Dart_NewString(script_name); |
| 156 | 155 |
| 157 return Dart_LoadScript(url, source, LibraryTagHandler); | 156 return Dart_LoadScript(url, source, LibraryTagHandler); |
| 158 } | 157 } |
| OLD | NEW |