Commit 5a94e63a authored by haraken's avatar haraken Committed by Commit bot

Make toV8(ScriptValue) never return an empty handle

I'm making toV8() never return an empty handle.
This CL replaces the return value of toV8(ScriptValue) with v8::Undefined,
but it won't change any web-exposed behavior because V8 interprets
a returned empty handle as v8::Undefined().

BUG=625512

Review-Url: https://codereview.chromium.org/2280893002
Cr-Commit-Position: refs/heads/master@{#414688}
parent a43a9eab
...@@ -185,17 +185,19 @@ inline v8::Local<v8::Value> toV8(const ToV8UndefinedGenerator& value, v8::Local ...@@ -185,17 +185,19 @@ inline v8::Local<v8::Value> toV8(const ToV8UndefinedGenerator& value, v8::Local
// ScriptValue // ScriptValue
inline v8::Local<v8::Value> toV8(const ScriptValue& value, v8::Local<v8::Object> creationContext, v8::Isolate*) inline v8::Local<v8::Value> toV8(const ScriptValue& value, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
{ {
if (value.isEmpty())
return v8::Undefined(isolate);
return value.v8Value(); return value.v8Value();
} }
// Dictionary // Dictionary
inline v8::Local<v8::Value> toV8(const Dictionary& value, v8::Local<v8::Object> creationContext, v8::Isolate*) inline v8::Local<v8::Value> toV8(const Dictionary& value, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
{ {
RELEASE_NOTREACHED(); NOTREACHED();
return v8::Local<v8::Value>(); return v8::Undefined(isolate);
} }
inline v8::Local<v8::Value> toV8(const IDLDictionaryBase& value, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) inline v8::Local<v8::Value> toV8(const IDLDictionaryBase& value, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment