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

Unified Diff: src/accessors.cc

Issue 516913003: Do not expose termination exceptions to the Exception API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comment Created 6 years, 4 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/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index 9a2431bbe731774c1794ea7d8108940b0142a00a..03ab9c4a3a8aeb9ccc725eccb6282647ee6eec46 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -262,9 +262,15 @@ void Accessors::ArrayLengthSetter(
return;
}
- isolate->ScheduleThrow(
- *isolate->factory()->NewRangeError("invalid_array_length",
- HandleVector<Object>(NULL, 0)));
+ Handle<Object> exception;
+ maybe = isolate->factory()->NewRangeError("invalid_array_length",
+ HandleVector<Object>(NULL, 0));
+ if (!maybe.ToHandle(&exception)) {
+ isolate->OptionalRescheduleException(false);
+ return;
+ }
+
+ isolate->ScheduleThrow(*exception);
}
@@ -1350,9 +1356,16 @@ static void ModuleGetExport(
Isolate* isolate = instance->GetIsolate();
if (value->IsTheHole()) {
Handle<String> name = v8::Utils::OpenHandle(*property);
- isolate->ScheduleThrow(
- *isolate->factory()->NewReferenceError("not_defined",
- HandleVector(&name, 1)));
+
+ Handle<Object> exception;
+ MaybeHandle<Object> maybe = isolate->factory()->NewReferenceError(
+ "not_defined", HandleVector(&name, 1));
+ if (!maybe.ToHandle(&exception)) {
+ isolate->OptionalRescheduleException(false);
+ return;
+ }
+
+ isolate->ScheduleThrow(*exception);
return;
}
info.GetReturnValue().Set(v8::Utils::ToLocal(Handle<Object>(value, isolate)));
@@ -1368,12 +1381,18 @@ static void ModuleSetExport(
DCHECK(context->IsModuleContext());
int slot = info.Data()->Int32Value();
Object* old_value = context->get(slot);
+ Isolate* isolate = context->GetIsolate();
if (old_value->IsTheHole()) {
Handle<String> name = v8::Utils::OpenHandle(*property);
- Isolate* isolate = instance->GetIsolate();
- isolate->ScheduleThrow(
- *isolate->factory()->NewReferenceError("not_defined",
- HandleVector(&name, 1)));
+ Handle<Object> exception;
+ MaybeHandle<Object> maybe = isolate->factory()->NewReferenceError(
+ "not_defined", HandleVector(&name, 1));
+ if (!maybe.ToHandle(&exception)) {
+ isolate->OptionalRescheduleException(false);
+ return;
+ }
+
+ isolate->ScheduleThrow(*exception);
return;
}
context->set(slot, *v8::Utils::OpenHandle(*value));
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698