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

Unified Diff: src/factory.cc

Issue 1158013003: Increase the chance of printing a useful error when bootstrapping fails (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix type handling in PendingCompilationErrorHandler Created 5 years, 7 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 | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index fe75c6bac066d25cc0eecb538665335de396784a..5db418f085e63241fa7765330a35bab9ef419536 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1087,6 +1087,13 @@ Handle<Object> Factory::NewError(const char* maker,
Handle<Object> arg2) {
HandleScope scope(isolate());
Handle<String> error_maker = InternalizeUtf8String(maker);
+ if (isolate()->bootstrapper()->IsActive()) {
+ // If this exception is being thrown during bootstrapping,
+ // js_builtins_object is unavailable. We return the error maker
+ // name's string as the exception since we have nothing better
+ // to do.
+ return scope.CloseAndEscape(error_maker);
+ }
Handle<Object> fun_obj = Object::GetProperty(isolate()->js_builtins_object(),
error_maker).ToHandleChecked();
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698