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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ToV8.h

Issue 2280893002: Make toV8(ScriptValue) never return an empty handle (Closed)
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ToV8.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8.h b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
index 0b35902f74b0966d9beceadbb7b9854ed413f81d..1ebd733aac239245971c6a65e54b76e4c9e4aca3 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ToV8.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ToV8.h
@@ -185,17 +185,19 @@ inline v8::Local<v8::Value> toV8(const ToV8UndefinedGenerator& value, v8::Local
// 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();
}
// 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();
- return v8::Local<v8::Value>();
+ NOTREACHED();
+ return v8::Undefined(isolate);
}
inline v8::Local<v8::Value> toV8(const IDLDictionaryBase& value, v8::Local<v8::Object> creationContext, v8::Isolate* isolate)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698