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

Unified Diff: Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp

Issue 1027593003: bindings: Use Maybe version of v8::String::NewFromUtf8() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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: Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
diff --git a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
index 8ea7fefeec70f34fab3df2327a6e7fd6bbb11f98..3926584e9322c343374adfdefd1a9b54c9869c8a 100644
--- a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
@@ -366,13 +366,13 @@ void V8InjectedScriptHost::evalMethodCustom(const v8::FunctionCallbackInfo<v8::V
{
v8::Isolate* isolate = info.GetIsolate();
if (info.Length() < 1) {
- isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, "One argument expected.")));
+ isolate->ThrowException(v8::Exception::Error(v8NormalString(isolate, "One argument expected.")));
return;
}
v8::Handle<v8::String> expression = info[0]->ToString(isolate);
if (expression.IsEmpty()) {
- isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, "The argument must be a string.")));
+ isolate->ThrowException(v8::Exception::Error(v8NormalString(isolate, "The argument must be a string.")));
return;
}
@@ -389,8 +389,8 @@ void V8InjectedScriptHost::evalMethodCustom(const v8::FunctionCallbackInfo<v8::V
static void setExceptionAsReturnValue(const v8::FunctionCallbackInfo<v8::Value>& info, v8::Local<v8::Object> returnValue, v8::TryCatch& tryCatch)
{
v8::Isolate* isolate = info.GetIsolate();
- returnValue->Set(v8::String::NewFromUtf8(isolate, "result"), tryCatch.Exception());
- returnValue->Set(v8::String::NewFromUtf8(isolate, "exceptionDetails"), JavaScriptCallFrame::createExceptionDetails(isolate, tryCatch.Message()));
+ returnValue->Set(v8NormalString(isolate, "result"), tryCatch.Exception());
+ returnValue->Set(v8NormalString(isolate, "exceptionDetails"), JavaScriptCallFrame::createExceptionDetails(isolate, tryCatch.Message()));
v8SetReturnValue(info, returnValue);
}
@@ -398,13 +398,13 @@ void V8InjectedScriptHost::evaluateWithExceptionDetailsMethodCustom(const v8::Fu
{
v8::Isolate* isolate = info.GetIsolate();
if (info.Length() < 1) {
- isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, "One argument expected.")));
+ isolate->ThrowException(v8::Exception::Error(v8NormalString(isolate, "One argument expected.")));
return;
}
v8::Handle<v8::String> expression = info[0]->ToString(isolate);
if (expression.IsEmpty()) {
- isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(isolate, "The argument must be a string.")));
+ isolate->ThrowException(v8::Exception::Error(v8NormalString(isolate, "The argument must be a string.")));
return;
}

Powered by Google App Engine
This is Rietveld 408576698