Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/templates/union_container.cpp |
| diff --git a/third_party/WebKit/Source/bindings/templates/union_container.cpp b/third_party/WebKit/Source/bindings/templates/union_container.cpp |
| index 920d223c1e320bd9f7dc59047cdf5313b882cdd8..e9467d44f5e3651d30efe2a165ffe7d6d6d117b7 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/union_container.cpp |
| +++ b/third_party/WebKit/Source/bindings/templates/union_container.cpp |
| @@ -10,6 +10,13 @@ if (V8{{member.type_name}}::hasInstance(v8Value, isolate)) { |
| return; |
| } |
| {% endmacro %} |
| +{% macro assign_and_return_if_isinstance(member) %} |
|
bashi
2016/05/20 08:32:46
drive-by: I'd prefer to add |is_instance_expressio
peria
2016/05/20 09:26:16
Done.
|
| +if (v8Value->Is{{member.type_name}}()) { |
| + {{member.cpp_local_type}} cppValue = V8{{member.type_name}}::toImpl(v8::Local<v8::Object>::Cast(v8Value)); |
| + impl.set{{member.type_name}}(cppValue); |
| + return; |
| +} |
| +{% endmacro %} |
| {% for filename in cpp_includes %} |
| #include "{{filename}}" |
| {% endfor %} |
| @@ -80,13 +87,13 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ |
| {% endfor %} |
| {# 8. ArrayBuffer #} |
| {% if array_buffer_type %} |
| - {{assign_and_return_if_hasinstance(array_buffer_type) | indent}} |
| + {{assign_and_return_if_isinstance(array_buffer_type) | indent}} |
| {% endif %} |
| {# 9., 10. ArrayBufferView #} |
| {# FIXME: Individual typed arrays (e.g. Uint8Array) aren't supported yet. #} |
| {% if array_buffer_view_type %} |
| - {{assign_and_return_if_hasinstance(array_buffer_view_type) | indent}} |
| + {{assign_and_return_if_isinstance(array_buffer_view_type) | indent}} |
| {% endif %} |
| {% if dictionary_type %} |