OLD | NEW |
---|---|
1 {##############################################################################} | 1 {##############################################################################} |
2 {% macro attribute_getter(attribute, world_suffix) %} | 2 {% macro attribute_getter(attribute, world_suffix) %} |
3 {% filter conditional(attribute.conditional_string) %} | 3 {% filter conditional(attribute.conditional_string) %} |
4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
5 {%- if attribute.is_expose_js_accessors %} | 5 {%- if attribute.is_expose_js_accessors %} |
6 const v8::FunctionCallbackInfo<v8::Value>& info | 6 const v8::FunctionCallbackInfo<v8::Value>& info |
7 {%- else %} | 7 {%- else %} |
8 const v8::PropertyCallbackInfo<v8::Value>& info | 8 const v8::PropertyCallbackInfo<v8::Value>& info |
9 {%- endif %}) | 9 {%- endif %}) |
10 { | 10 { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #} | 255 TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #} |
256 if (!cppValue{% if attribute.is_nullable %} && !isUndefinedOrNull(v8Value){% endif %}) { | 256 if (!cppValue{% if attribute.is_nullable %} && !isUndefinedOrNull(v8Value){% endif %}) { |
257 exceptionState.throwTypeError("The provided value is not of type '{{attr ibute.idl_type}}'."); | 257 exceptionState.throwTypeError("The provided value is not of type '{{attr ibute.idl_type}}'."); |
258 exceptionState.throwIfNeeded(); | 258 exceptionState.throwIfNeeded(); |
259 return; | 259 return; |
260 } | 260 } |
261 {% elif attribute.enum_validation_expression %} | 261 {% elif attribute.enum_validation_expression %} |
262 {# Setter ignores invalid enum values: | 262 {# Setter ignores invalid enum values: |
263 http://www.w3.org/TR/WebIDL/#idl-enums #} | 263 http://www.w3.org/TR/WebIDL/#idl-enums #} |
264 String string = cppValue; | 264 String string = cppValue; |
265 if (!({{attribute.enum_validation_expression}})) | 265 if (!({{attribute.enum_validation_expression}})) { |
266 currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMes sage::create(JSMessageSource, ErrorMessageLevel, "The provided value '" + string + "' is not a valid value of type '{{attribute.idl_type}}'.")); | |
Nils Barth (inactive)
2015/03/02 16:24:00
ErrorMessageLevel → WarningMessageLevel
| |
266 return; | 267 return; |
268 } | |
267 {% endif %} | 269 {% endif %} |
268 {# Pre-set context #} | 270 {# Pre-set context #} |
269 {% if attribute.is_custom_element_callbacks or | 271 {% if attribute.is_custom_element_callbacks or |
270 (attribute.is_reflect and | 272 (attribute.is_reflect and |
271 not(attribute.idl_type == 'DOMString' and is_node)) %} | 273 not(attribute.idl_type == 'DOMString' and is_node)) %} |
272 {# Skip on compact node DOMString getters #} | 274 {# Skip on compact node DOMString getters #} |
273 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | 275 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; |
274 {% endif %} | 276 {% endif %} |
275 {% if attribute.is_call_with_execution_context or | 277 {% if attribute.is_call_with_execution_context or |
276 attribute.is_setter_call_with_execution_context %} | 278 attribute.is_setter_call_with_execution_context %} |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 access_control, | 434 access_control, |
433 property_attribute, | 435 property_attribute, |
434 only_exposed_to_private_script, | 436 only_exposed_to_private_script, |
435 ] %} | 437 ] %} |
436 {% if not attribute.is_expose_js_accessors %} | 438 {% if not attribute.is_expose_js_accessors %} |
437 {% set attribute_configuration_list = attribute_configuration_list | 439 {% set attribute_configuration_list = attribute_configuration_list |
438 + [on_prototype] %} | 440 + [on_prototype] %} |
439 {% endif %} | 441 {% endif %} |
440 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} | 442 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} |
441 {%- endmacro %} | 443 {%- endmacro %} |
OLD | NEW |