| Index: runtime/bin/builtin.cc
|
| diff --git a/runtime/bin/builtin.cc b/runtime/bin/builtin.cc
|
| index cbc20063738280c799ba3b867b3f8c5f71196feb..73f54fd43c1e7d5cdaa568f4775aad312c16b3d0 100644
|
| --- a/runtime/bin/builtin.cc
|
| +++ b/runtime/bin/builtin.cc
|
| @@ -42,15 +42,21 @@ Dart_Port Builtin::load_port_ = ILLEGAL_PORT;
|
| const int Builtin::num_libs_ =
|
| sizeof(Builtin::builtin_libraries_) / sizeof(Builtin::builtin_lib_props);
|
|
|
| +static const bool use_builtin_source_paths = false;
|
| +
|
| // Patch all the specified patch files in the array 'patch_files' into the
|
| // library specified in 'library'.
|
| static void LoadPatchFiles(Dart_Handle library,
|
| const char* patch_uri,
|
| const char** patch_files) {
|
| for (intptr_t j = 0; patch_files[j] != NULL; j += 3) {
|
| - Dart_Handle patch_src = DartUtils::ReadStringFromFile(patch_files[j + 1]);
|
| + Dart_Handle patch_src = Dart_Null();
|
| + if (use_builtin_source_paths) {
|
| + patch_src = DartUtils::ReadStringFromFile(patch_files[j + 1]);
|
| + }
|
| if (!Dart_IsString(patch_src)) {
|
| - // In case reading the file caused an error, use the sources directly.
|
| + // If use_builtin_source_paths is false or reading the file caused
|
| + // an error, use the sources linked in the binary.
|
| const char* source = patch_files[j + 2];
|
| patch_src = Dart_NewStringFromUTF8(
|
| reinterpret_cast<const uint8_t*>(source), strlen(source));
|
| @@ -95,9 +101,13 @@ Dart_Handle Builtin::GetSource(const char** source_paths, const char* uri) {
|
| for (intptr_t i = 0; source_paths[i] != NULL; i += 3) {
|
| if (!strcmp(uri, source_paths[i])) {
|
| const char* source_path = source_paths[i + 1];
|
| - Dart_Handle src = DartUtils::ReadStringFromFile(source_path);
|
| + Dart_Handle src = Dart_Null();
|
| + if (use_builtin_source_paths) {
|
| + src = DartUtils::ReadStringFromFile(source_path);
|
| + }
|
| if (!Dart_IsString(src)) {
|
| - // In case reading the file caused an error, use the sources directly.
|
| + // If use_builtin_source_paths is false or reading the file caused
|
| + // an error, use the sources linked in the binary.
|
| const char* source = source_paths[i + 2];
|
| src = Dart_NewStringFromUTF8(reinterpret_cast<const uint8_t*>(source),
|
| strlen(source));
|
|
|