OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
183 void operator=(v8::Handle<v8::Value> object) | 183 void operator=(v8::Handle<v8::Value> object) |
184 { | 184 { |
185 m_v8Object = object; | 185 m_v8Object = object; |
186 } | 186 } |
187 | 187 |
188 void operator=(const String& string) | 188 void operator=(const String& string) |
189 { | 189 { |
190 setString(string); | 190 setString(string); |
191 } | 191 } |
192 | 192 |
193 void operator=(std::nullptr_t) | |
Nils Barth (inactive)
2014/06/17 03:40:32
BTW, is this going away, as |null| is invalid for
| |
194 { | |
195 setString(String()); | |
196 } | |
197 | |
193 bool prepare() | 198 bool prepare() |
194 { | 199 { |
195 if (m_v8Object.IsEmpty()) | 200 if (m_v8Object.IsEmpty()) |
196 return true; | 201 return true; |
197 | 202 |
198 if (!isValid()) { | 203 if (!isValid()) { |
199 setString(String()); | 204 setString(String()); |
200 return true; | 205 return true; |
201 } | 206 } |
202 | 207 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 } | 260 } |
256 | 261 |
257 template<> inline bool V8StringResource<WithUndefinedOrNullCheck>::isValid() con st | 262 template<> inline bool V8StringResource<WithUndefinedOrNullCheck>::isValid() con st |
258 { | 263 { |
259 return !m_v8Object->IsNull() && !m_v8Object->IsUndefined(); | 264 return !m_v8Object->IsNull() && !m_v8Object->IsUndefined(); |
260 } | 265 } |
261 | 266 |
262 } // namespace WebCore | 267 } // namespace WebCore |
263 | 268 |
264 #endif // V8StringResource_h | 269 #endif // V8StringResource_h |
OLD | NEW |