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

Unified Diff: src/extensions/externalize-string-extension.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. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/extensions/externalize-string-extension.cc
diff --git a/src/extensions/externalize-string-extension.cc b/src/extensions/externalize-string-extension.cc
index 5fd821b9c07385b53714b200f48a90a2126da75f..01397cd4f498bc8a80ead3680e0b91c2c9f41c5c 100644
--- a/src/extensions/externalize-string-extension.cc
+++ b/src/extensions/externalize-string-extension.cc
@@ -75,8 +75,10 @@ v8::Handle<v8::FunctionTemplate> ExternalizeStringExtension::GetNativeFunction(
void ExternalizeStringExtension::Externalize(
const v8::FunctionCallbackInfo<v8::Value>& args) {
if (args.Length() < 1 || !args[0]->IsString()) {
- v8::ThrowException(v8::String::New(
- "First parameter to externalizeString() must be a string."));
+ v8::ThrowException(
+ args.GetIsolate(),
+ v8::String::New(
+ "First parameter to externalizeString() must be a string."));
return;
}
bool force_two_byte = false;
@@ -84,16 +86,20 @@ void ExternalizeStringExtension::Externalize(
if (args[1]->IsBoolean()) {
force_two_byte = args[1]->BooleanValue();
} else {
- v8::ThrowException(v8::String::New(
- "Second parameter to externalizeString() must be a boolean."));
+ v8::ThrowException(
+ args.GetIsolate(),
+ v8::String::New(
+ "Second parameter to externalizeString() must be a boolean."));
return;
}
}
bool result = false;
Handle<String> string = Utils::OpenHandle(*args[0].As<v8::String>());
if (string->IsExternalString()) {
- v8::ThrowException(v8::String::New(
- "externalizeString() can't externalize twice."));
+ v8::ThrowException(
+ args.GetIsolate(),
+ v8::String::New(
+ "externalizeString() can't externalize twice."));
return;
}
if (string->IsOneByteRepresentation() && !force_two_byte) {
@@ -129,8 +135,10 @@ void ExternalizeStringExtension::Externalize(
void ExternalizeStringExtension::IsAscii(
const v8::FunctionCallbackInfo<v8::Value>& args) {
if (args.Length() != 1 || !args[0]->IsString()) {
- v8::ThrowException(v8::String::New(
- "isAsciiString() requires a single string argument."));
+ v8::ThrowException(
+ args.GetIsolate(),
+ v8::String::New(
+ "isAsciiString() requires a single string argument."));
return;
}
bool is_one_byte =
« include/v8.h ('K') | « src/d8-posix.cc ('k') | test/cctest/test-accessors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698