OLD | NEW |
1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
2 | 2 |
3 | 3 |
4 {##############################################################################} | 4 {##############################################################################} |
5 {% macro attribute_configuration(attribute) %} | 5 {% macro attribute_configuration(attribute) %} |
6 {% set getter_callback = | 6 {% set getter_callback = |
7 '%sV8Internal::%sAttributeGetterCallback' % | 7 '%sV8Internal::%sAttributeGetterCallback' % |
8 (cpp_class, attribute.name) | 8 (cpp_class, attribute.name) |
9 if not attribute.constructor_type else | 9 if not attribute.constructor_type else |
10 ('%sV8Internal::%sConstructorGetterCallback' % | 10 ('%sV8Internal::%sConstructorGetterCallback' % |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 { | 338 { |
339 {% if not is_override_builtins %} | 339 {% if not is_override_builtins %} |
340 if (info.Holder()->HasRealNamedProperty(name)) | 340 if (info.Holder()->HasRealNamedProperty(name)) |
341 return; | 341 return; |
342 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 342 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
343 return; | 343 return; |
344 | 344 |
345 {% endif %} | 345 {% endif %} |
346 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder()); | 346 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder()); |
347 {# v8_value_to_local_cpp_value('DOMString', 'name', 'propertyName') #} | 347 {# v8_value_to_local_cpp_value('DOMString', 'name', 'propertyName') #} |
348 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name)
; | 348 V8STRINGRESOURCE_PREPARE_VOID(V8StringResource<>, propertyName, name); |
349 {{setter.v8_value_to_local_cpp_value}}; | 349 {{setter.v8_value_to_local_cpp_value}}; |
350 {% if setter.has_exception_state %} | 350 {% if setter.has_exception_state %} |
351 v8::String::Utf8Value namedProperty(name); | 351 v8::String::Utf8Value namedProperty(name); |
352 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty,
"{{interface_name}}", info.Holder(), info.GetIsolate()); | 352 ExceptionState exceptionState(ExceptionState::SetterContext, *namedProperty,
"{{interface_name}}", info.Holder(), info.GetIsolate()); |
353 {% endif %} | 353 {% endif %} |
354 {% set setter_name = setter.name or 'anonymousNamedSetter' %} | 354 {% set setter_name = setter.name or 'anonymousNamedSetter' %} |
355 {% set setter_arguments = | 355 {% set setter_arguments = |
356 ['propertyName', 'propertyValue', 'exceptionState'] | 356 ['propertyName', 'propertyValue', 'exceptionState'] |
357 if setter.is_raises_exception else | 357 if setter.is_raises_exception else |
358 ['propertyName', 'propertyValue'] %} | 358 ['propertyName', 'propertyValue'] %} |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 619 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
620 { | 620 { |
621 v8::Isolate* isolate = info.GetIsolate(); | 621 v8::Isolate* isolate = info.GetIsolate(); |
622 ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interf
ace_name}}", info.Holder(), isolate); | 622 ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interf
ace_name}}", info.Holder(), isolate); |
623 if (info.Length() < 1) { | 623 if (info.Length() < 1) { |
624 exceptionState.throwTypeError("An event name must be provided."); | 624 exceptionState.throwTypeError("An event name must be provided."); |
625 exceptionState.throwIfNeeded(); | 625 exceptionState.throwIfNeeded(); |
626 return; | 626 return; |
627 } | 627 } |
628 | 628 |
629 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]); | 629 V8STRINGRESOURCE_PREPARE_VOID(V8StringResource<>, type, info[0]); |
630 {% for attribute in any_type_attributes %} | 630 {% for attribute in any_type_attributes %} |
631 v8::Local<v8::Value> {{attribute.name}}; | 631 v8::Local<v8::Value> {{attribute.name}}; |
632 {% endfor %} | 632 {% endfor %} |
633 {{cpp_class}}Init eventInit; | 633 {{cpp_class}}Init eventInit; |
634 if (info.Length() >= 2) { | 634 if (info.Length() >= 2) { |
635 V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], isolate)); | 635 V8TRYCATCH_VOID(Dictionary, options, Dictionary(info[1], isolate)); |
636 if (!initialize{{cpp_class}}(eventInit, options, exceptionState, info))
{ | 636 if (!initialize{{cpp_class}}(eventInit, options, exceptionState, info))
{ |
637 exceptionState.throwIfNeeded(); | 637 exceptionState.throwIfNeeded(); |
638 return; | 638 return; |
639 } | 639 } |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 {% endfilter %} | 1315 {% endfilter %} |
1316 } | 1316 } |
1317 | 1317 |
1318 template<> | 1318 template<> |
1319 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 1319 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
1320 { | 1320 { |
1321 return toV8(impl, creationContext, isolate); | 1321 return toV8(impl, creationContext, isolate); |
1322 } | 1322 } |
1323 | 1323 |
1324 {% endblock %} | 1324 {% endblock %} |
OLD | NEW |