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

Unified Diff: src/parser.cc

Issue 885043002: [V8] Added line, column and script symbols for SyntaxError (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 11 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/isolate.cc ('k') | test/cctest/test-api.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 a4735520366b9f91e98dcc592fc6929fd7de72a7..f16473c8ae6798b9bc29e6f14a3f36bb5b6b879a 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4256,7 +4256,26 @@ void Parser::ThrowPendingError() {
pending_error_is_reference_error_
? factory->NewReferenceError(pending_error_message_, array)
: factory->NewSyntaxError(pending_error_message_, array);
- if (maybe_error.ToHandle(&error)) isolate()->Throw(*error, &location);
+
+ if (maybe_error.ToHandle(&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_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();
+
+ isolate()->Throw(*error, &location);
+ }
}
}
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698