| OLD | NEW |
| 1 {% filter format_blink_cpp_source_code %} | 1 {% filter format_blink_cpp_source_code %} |
| 2 | 2 |
| 3 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable %} | 3 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable %} |
| 4 {% include 'copyright_block.txt' %} | 4 {% include 'copyright_block.txt' %} |
| 5 #include "{{v8_original_class}}.h" | 5 #include "{{v8_original_class}}.h" |
| 6 | 6 |
| 7 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} | 7 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} |
| 8 #include "{{filename}}" | 8 #include "{{filename}}" |
| 9 {% endfor %} | 9 {% endfor %} |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 bool toV8{{cpp_class}}(const {{cpp_class}}& impl, v8::Local<v8::Object> dictiona
ry, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) { | 99 bool toV8{{cpp_class}}(const {{cpp_class}}& impl, v8::Local<v8::Object> dictiona
ry, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) { |
| 100 {% if parent_v8_class %} | 100 {% if parent_v8_class %} |
| 101 if (!toV8{{parent_cpp_class}}(impl, dictionary, creationContext, isolate)) | 101 if (!toV8{{parent_cpp_class}}(impl, dictionary, creationContext, isolate)) |
| 102 return false; | 102 return false; |
| 103 | 103 |
| 104 {% endif %} | 104 {% endif %} |
| 105 {% for member in members %} | 105 {% for member in members %} |
| 106 if (impl.{{member.has_method_name}}()) { | 106 if (impl.{{member.has_method_name}}()) { |
| 107 {% if member.is_object %} | 107 {% if member.is_object %} |
| 108 DCHECK(impl.{{member.cpp_name}}().isObject()); | 108 DCHECK(impl.{{member.getter_name}}().isObject()); |
| 109 {% endif %} | 109 {% endif %} |
| 110 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8String(isolate, "{{member.name}}"), {{member.cpp_value_to_v8_value}}))) | 110 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8String(isolate, "{{member.name}}"), {{member.cpp_value_to_v8_value}}))) |
| 111 return false; | 111 return false; |
| 112 {% if member.v8_default_value %} | 112 {% if member.v8_default_value %} |
| 113 } else { | 113 } else { |
| 114 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8String(isolate, "{{member.name}}"), {{member.v8_default_value}}))) | 114 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8String(isolate, "{{member.name}}"), {{member.v8_default_value}}))) |
| 115 return false; | 115 return false; |
| 116 {% elif member.is_nullable %} | 116 {% elif member.is_nullable %} |
| 117 } else { | 117 } else { |
| 118 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8String(isolate, "{{member.name}}"), v8::Null(isolate)))) | 118 if (!v8CallBoolean(dictionary->CreateDataProperty(isolate->GetCurrentContext
(), v8String(isolate, "{{member.name}}"), v8::Null(isolate)))) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 129 | 129 |
| 130 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate
, v8::Local<v8::Value> value, ExceptionState& exceptionState) { | 130 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate
, v8::Local<v8::Value> value, ExceptionState& exceptionState) { |
| 131 {{cpp_class}} impl; | 131 {{cpp_class}} impl; |
| 132 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); | 132 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); |
| 133 return impl; | 133 return impl; |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace blink | 136 } // namespace blink |
| 137 | 137 |
| 138 {% endfilter %}{# format_blink_cpp_source_code #} | 138 {% endfilter %}{# format_blink_cpp_source_code #} |
| OLD | NEW |