summaryrefslogtreecommitdiff
path: root/deps/v8/src/pending-compilation-error-handler.cc
diff options
context:
space:
mode:
authorAli Ijaz Sheikh <ofrobots@google.com>2015-08-23 06:09:40 -0700
committerRod Vagg <rod@vagg.org>2015-09-06 21:38:01 +1000
commit9fddd83cf9adf505bce2e2373881df0c4d41b261 (patch)
tree4272ce14c10fea496af2e78fc6debb187d613451 /deps/v8/src/pending-compilation-error-handler.cc
parent46b7d151674d138e7ea4342d5f3ada1208b87ff2 (diff)
downloadnode-new-9fddd83cf9adf505bce2e2373881df0c4d41b261.tar.gz
deps: upgrade V8 to 4.5.103.24
Upgrade to the latest branch-head for V8 4.5. For the full commit log see https://github.com/v8/v8-git-mirror/commits/4.5.103.24 PR-URL: https://github.com/nodejs/node/pull/2509 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/src/pending-compilation-error-handler.cc')
-rw-r--r--deps/v8/src/pending-compilation-error-handler.cc29
1 files changed, 16 insertions, 13 deletions
diff --git a/deps/v8/src/pending-compilation-error-handler.cc b/deps/v8/src/pending-compilation-error-handler.cc
index f0449d82a9..10a10320a6 100644
--- a/deps/v8/src/pending-compilation-error-handler.cc
+++ b/deps/v8/src/pending-compilation-error-handler.cc
@@ -17,32 +17,35 @@ void PendingCompilationErrorHandler::ThrowPendingError(Isolate* isolate,
if (!has_pending_error_) return;
MessageLocation location(script, start_position_, end_position_);
Factory* factory = isolate->factory();
- bool has_arg = arg_ != NULL || char_arg_ != NULL || !handle_arg_.is_null();
- Handle<FixedArray> elements = factory->NewFixedArray(has_arg ? 1 : 0);
+ Handle<String> argument;
if (arg_ != NULL) {
- Handle<String> arg_string = arg_->string();
- elements->set(0, *arg_string);
+ argument = arg_->string();
} else if (char_arg_ != NULL) {
- Handle<String> arg_string =
+ argument =
factory->NewStringFromUtf8(CStrVector(char_arg_)).ToHandleChecked();
- elements->set(0, *arg_string);
} else if (!handle_arg_.is_null()) {
- elements->set(0, *handle_arg_);
+ argument = handle_arg_;
}
isolate->debug()->OnCompileError(script);
- Handle<JSArray> array = factory->NewJSArrayWithElements(elements);
Handle<Object> error;
-
switch (error_type_) {
case kReferenceError:
- error = factory->NewReferenceError(message_, array);
+ error = factory->NewError("MakeReferenceError", message_, argument);
break;
case kSyntaxError:
- error = factory->NewSyntaxError(message_, array);
+ error = factory->NewError("MakeSyntaxError", message_, argument);
+ break;
+ default:
+ UNREACHABLE();
break;
}
+ if (!error->IsJSObject()) {
+ isolate->Throw(*error, &location);
+ return;
+ }
+
Handle<JSObject> jserror = Handle<JSObject>::cast(error);
Handle<Name> key_start_pos = factory->error_start_pos_symbol();
@@ -60,5 +63,5 @@ void PendingCompilationErrorHandler::ThrowPendingError(Isolate* isolate,
isolate->Throw(*error, &location);
}
-}
-} // namespace v8::internal
+} // namespace internal
+} // namespace v8