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

Unified Diff: src/parser.cc

Issue 952483002: NewError no longer returns a MaybeObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@reland
Patch Set: Created 5 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 | « src/objects.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 54e4c7cec15b1ed18f2fedcf36db47fb8ed6a126..2d59e1a5ab79705454cbb37d3e7da5d5dea8ba0a 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4289,35 +4289,31 @@ void Parser::ThrowPendingError(Isolate* isolate, Handle<Script> script) {
Handle<JSArray> array = factory->NewJSArrayWithElements(elements);
Handle<Object> error;
- MaybeHandle<Object> maybe_error;
switch (pending_error_type_) {
case kReferenceError:
- maybe_error = factory->NewReferenceError(pending_error_message_, array);
+ error = factory->NewReferenceError(pending_error_message_, array);
break;
case kSyntaxError:
- maybe_error = factory->NewSyntaxError(pending_error_message_, array);
+ error = factory->NewSyntaxError(pending_error_message_, array);
break;
}
- DCHECK(!maybe_error.is_null() || isolate->has_pending_exception());
- if (maybe_error.ToHandle(&error)) {
- Handle<JSObject> jserror = Handle<JSObject>::cast(error);
+ Handle<JSObject> jserror = Handle<JSObject>::cast(error);
- Handle<Name> key_start_pos = factory->error_start_pos_symbol();
- JSObject::SetProperty(jserror, key_start_pos,
- handle(Smi::FromInt(location.start_pos()), isolate),
- SLOPPY).Check();
+ Handle<Name> key_start_pos = factory->error_start_pos_symbol();
+ JSObject::SetProperty(jserror, key_start_pos,
+ handle(Smi::FromInt(location.start_pos()), isolate),
+ SLOPPY).Check();
- Handle<Name> key_end_pos = factory->error_end_pos_symbol();
- JSObject::SetProperty(jserror, key_end_pos,
- handle(Smi::FromInt(location.end_pos()), isolate),
- SLOPPY).Check();
+ Handle<Name> key_end_pos = factory->error_end_pos_symbol();
+ JSObject::SetProperty(jserror, key_end_pos,
+ handle(Smi::FromInt(location.end_pos()), isolate),
+ SLOPPY).Check();
- Handle<Name> key_script = factory->error_script_symbol();
- JSObject::SetProperty(jserror, key_script, script, SLOPPY).Check();
+ Handle<Name> key_script = factory->error_script_symbol();
+ JSObject::SetProperty(jserror, key_script, script, SLOPPY).Check();
- isolate->Throw(*error, &location);
- }
+ isolate->Throw(*error, &location);
}
}
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698