Chromium Code Reviews

Unified Diff: samples/shell.cc

Issue 24538002: add isolate parameter to ThrowException (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« include/v8.h ('K') | « samples/lineprocessor.cc ('k') | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/shell.cc
diff --git a/samples/shell.cc b/samples/shell.cc
index 710547c341979eaa6f42194a1b10d2ee183a561f..d073e4173fb4c8a60bacb890797bad3c7f80c2f4 100644
--- a/samples/shell.cc
+++ b/samples/shell.cc
@@ -140,17 +140,20 @@ void Print(const v8::FunctionCallbackInfo<v8::Value>& args) {
// the argument into a JavaScript string.
void Read(const v8::FunctionCallbackInfo<v8::Value>& args) {
if (args.Length() != 1) {
- v8::ThrowException(v8::String::New("Bad parameters"));
+ v8::ThrowException(args.GetIsolate(),
+ v8::String::New("Bad parameters"));
return;
}
v8::String::Utf8Value file(args[0]);
if (*file == NULL) {
- v8::ThrowException(v8::String::New("Error loading file"));
+ v8::ThrowException(args.GetIsolate(),
+ v8::String::New("Error loading file"));
return;
}
v8::Handle<v8::String> source = ReadFile(*file);
if (source.IsEmpty()) {
- v8::ThrowException(v8::String::New("Error loading file"));
+ v8::ThrowException(args.GetIsolate(),
+ v8::String::New("Error loading file"));
return;
}
args.GetReturnValue().Set(source);
@@ -165,12 +168,14 @@ void Load(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::HandleScope handle_scope(args.GetIsolate());
v8::String::Utf8Value file(args[i]);
if (*file == NULL) {
- v8::ThrowException(v8::String::New("Error loading file"));
+ v8::ThrowException(args.GetIsolate(),
+ v8::String::New("Error loading file"));
return;
}
v8::Handle<v8::String> source = ReadFile(*file);
if (source.IsEmpty()) {
- v8::ThrowException(v8::String::New("Error loading file"));
+ v8::ThrowException(args.GetIsolate(),
+ v8::String::New("Error loading file"));
return;
}
if (!ExecuteString(args.GetIsolate(),
@@ -178,7 +183,8 @@ void Load(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::String::New(*file),
false,
false)) {
- v8::ThrowException(v8::String::New("Error executing file"));
+ v8::ThrowException(args.GetIsolate(),
+ v8::String::New("Error executing file"));
return;
}
}
« include/v8.h ('K') | « samples/lineprocessor.cc ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine