Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: runtime/bin/gen_snapshot.cc

Issue 2694623008: Fix double-printing of loading errors in gen_snapshot. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/gen_snapshot.cc
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 732493d5fe11dd42cf3c9cdf7dad25252f531a6f..3f2940dc74b91486fbfbe31f3883063498e5a768 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -674,16 +674,6 @@ static void PrintUsage() {
// clang-format on
-static void VerifyLoaded(Dart_Handle library) {
- if (Dart_IsError(library)) {
- const char* err_msg = Dart_GetError(library);
- Log::PrintErr("Errors encountered while loading: %s\n", err_msg);
- CHECK_RESULT(library);
- }
- ASSERT(Dart_IsLibrary(library));
-}
-
-
static const char StubNativeFunctionName[] = "StubNativeFunction";
@@ -1120,7 +1110,7 @@ static void SetupForUriResolution() {
// This is a generic dart snapshot which needs builtin library setup.
Dart_Handle library =
LoadGenericSnapshotCreationScript(Builtin::kBuiltinLibrary);
- VerifyLoaded(library);
+ CHECK_RESULT(library);
}
@@ -1128,7 +1118,7 @@ static void SetupForGenericSnapshotCreation() {
SetupForUriResolution();
Dart_Handle library = LoadGenericSnapshotCreationScript(Builtin::kIOLibrary);
- VerifyLoaded(library);
+ CHECK_RESULT(library);
Dart_Handle result = Dart_FinalizeLoading(false);
if (Dart_IsError(result)) {
const char* err_msg = Dart_GetError(library);
@@ -1352,7 +1342,7 @@ int main(int argc, char** argv) {
if (!is_kernel_file) {
// Load the specified script.
library = LoadSnapshotCreationScript(app_script_name);
- VerifyLoaded(library);
+ CHECK_RESULT(library);
ImportNativeEntryPointLibrariesIntoRoot(entry_points);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698