Index: Source/bindings/v8/V8StringResource.h |
diff --git a/Source/bindings/v8/V8StringResource.h b/Source/bindings/v8/V8StringResource.h |
index feb63a990952c79ad04828cd77fe693c67edb140..ddac5697e33881b82b56926545bc1e66ce3eb651 100644 |
--- a/Source/bindings/v8/V8StringResource.h |
+++ b/Source/bindings/v8/V8StringResource.h |
@@ -166,6 +166,7 @@ String int32ToWebCoreString(int value); |
// or AtomicStrings as appropriate, using multiple typecast operators. |
enum V8StringResourceMode { |
DefaultMode, |
+ TreatNullAsEmptyString, |
WithNullCheck, |
WithUndefinedOrNullCheck |
haraken
2014/01/15 11:57:36
Shall we also rename WithNullCheck to TreatNullAsN
arv (Not doing code reviews)
2014/01/15 15:44:59
sounds good to me
|
}; |
@@ -234,6 +235,15 @@ template<> inline bool V8StringResource<DefaultMode>::prepare() |
return prepareBase(); |
} |
+template<> inline bool V8StringResource<TreatNullAsEmptyString>::prepare() |
+{ |
+ if (m_v8Object.IsEmpty() || m_v8Object->IsNull()) { |
+ setString(emptyString()); |
+ return true; |
+ } |
+ return prepareBase(); |
+} |
+ |
template<> inline bool V8StringResource<WithNullCheck>::prepare() |
{ |
if (m_v8Object.IsEmpty() || m_v8Object->IsNull()) { |