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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.cpp

Issue 2476393003: V8ObjectBuilder::addString support Nullable. (Closed)
Patch Set: Add V8ObjectBuilderTest Created 4 years, 1 month 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: third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.cpp
index 571f400aed419b717c9ef6fa39b60f33d737cb34..d797add21184c0d7ab36d96f38c459985b8cb149 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ObjectBuilder.cpp
@@ -35,8 +35,13 @@ V8ObjectBuilder& V8ObjectBuilder::addNumber(const String& name, double value) {
}
V8ObjectBuilder& V8ObjectBuilder::addString(const String& name,
- const String& value) {
- addInternal(name, v8String(m_scriptState->isolate(), value));
+ const String& value,
+ bool isNullable) {
+ if (isNullable && value.isNull()) {
+ addInternal(name, v8::Null(m_scriptState->isolate()));
+ } else {
+ addInternal(name, v8String(m_scriptState->isolate(), value));
+ }
return *this;
}

Powered by Google App Engine
This is Rietveld 408576698