OLD | NEW |
1 {% from 'conversions.cpp' import declare_enum_validation_variable %} | 1 {% from 'conversions.cpp' import declare_enum_validation_variable %} |
2 {% include 'copyright_block.txt' %} | 2 {% include 'copyright_block.txt' %} |
3 #include "config.h" | 3 #include "config.h" |
4 #include "{{v8_original_class}}.h" | 4 #include "{{v8_original_class}}.h" |
5 | 5 |
6 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} | 6 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} |
7 #include "{{filename}}" | 7 #include "{{filename}}" |
8 {% endfor %} | 8 {% endfor %} |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 {% if member.is_interface_type %} | 65 {% if member.is_interface_type %} |
66 if (!{{member.name}} && !{{member.name}}Value->IsNull()) { | 66 if (!{{member.name}} && !{{member.name}}Value->IsNull()) { |
67 exceptionState.throwTypeError("member {{member.name}} is not of
type {{member.idl_type}}."); | 67 exceptionState.throwTypeError("member {{member.name}} is not of
type {{member.idl_type}}."); |
68 return; | 68 return; |
69 } | 69 } |
70 {% endif %} | 70 {% endif %} |
71 {% if member.enum_values %} | 71 {% if member.enum_values %} |
72 {{declare_enum_validation_variable(member.enum_values) | indent(12)}
} | 72 {{declare_enum_validation_variable(member.enum_values) | indent(12)}
} |
73 if (!isValidEnum({{member.name}}, validValues, WTF_ARRAY_LENGTH(vali
dValues), "{{member.enum_type}}", exceptionState)) | 73 if (!isValidEnum({{member.name}}, validValues, WTF_ARRAY_LENGTH(vali
dValues), "{{member.enum_type}}", exceptionState)) |
74 return; | 74 return; |
75 {% elif member.is_object %} | 75 {% elif member.is_object or member.is_deprecated_dictionary %} |
76 if (!{{member.name}}.isObject()) { | 76 if (!{{member.name}}.isObject()) { |
77 exceptionState.throwTypeError("member {{member.name}} is not an
object."); | 77 exceptionState.throwTypeError("member {{member.name}} is not an
object."); |
78 return; | 78 return; |
79 } | 79 } |
80 {% endif %} | 80 {% endif %} |
81 impl.{{member.setter_name}}({{member.name}}); | 81 impl.{{member.setter_name}}({{member.name}}); |
82 } | 82 } |
83 } | 83 } |
84 | 84 |
85 {% endfor %} | 85 {% endfor %} |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 | 122 |
123 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate
, v8::Local<v8::Value> value, ExceptionState& exceptionState) | 123 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate
, v8::Local<v8::Value> value, ExceptionState& exceptionState) |
124 { | 124 { |
125 {{cpp_class}} impl; | 125 {{cpp_class}} impl; |
126 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); | 126 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); |
127 return impl; | 127 return impl; |
128 } | 128 } |
129 | 129 |
130 } // namespace blink | 130 } // namespace blink |
OLD | NEW |