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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 {% endif %} | 586 {% endif %} |
587 {% endblock %} | 587 {% endblock %} |
588 | 588 |
589 {##############################################################################} | 589 {##############################################################################} |
590 {% block overloaded_constructor %} | 590 {% block overloaded_constructor %} |
591 {% if constructor_overloads %} | 591 {% if constructor_overloads %} |
592 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 592 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
593 { | 593 { |
594 v8::Isolate* isolate = info.GetIsolate(); | 594 v8::Isolate* isolate = info.GetIsolate(); |
595 ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interf
ace_name}}", info.Holder(), isolate); | 595 ExceptionState exceptionState(ExceptionState::ConstructionContext, "{{interf
ace_name}}", info.Holder(), isolate); |
596 {# FIXME: 2. Initialize argcount to be min(maxarg, n). #} | 596 {# 2. Initialize argcount to be min(maxarg, n). #} |
597 {# switch (std::min({{constructor_overloads.maxarg}}, info.Length())) { #} | 597 switch (std::min({{constructor_overloads.maxarg}}, info.Length())) { |
598 switch (info.Length()) { | |
599 {# 3. Remove from S all entries whose type list is not of length argcount. #
} | 598 {# 3. Remove from S all entries whose type list is not of length argcount. #
} |
600 {% for length, tests_constructors in constructor_overloads.length_tests_meth
ods %} | 599 {% for length, tests_constructors in constructor_overloads.length_tests_meth
ods %} |
601 case {{length}}: | 600 case {{length}}: |
602 {# Then resolve by testing argument #} | 601 {# Then resolve by testing argument #} |
603 {% for test, constructor in tests_constructors %} | 602 {% for test, constructor in tests_constructors %} |
604 {# 10. If i = d, then: #} | 603 {# 10. If i = d, then: #} |
605 if ({{test}}) { | 604 if ({{test}}) { |
606 {{cpp_class}}V8Internal::constructor{{constructor.overload_index}}(i
nfo); | 605 {{cpp_class}}V8Internal::constructor{{constructor.overload_index}}(i
nfo); |
607 return; | 606 return; |
608 } | 607 } |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 {% endif %} | 1335 {% endif %} |
1337 } | 1336 } |
1338 | 1337 |
1339 template<> | 1338 template<> |
1340 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 1339 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
1341 { | 1340 { |
1342 return toV8(impl, creationContext, isolate); | 1341 return toV8(impl, creationContext, isolate); |
1343 } | 1342 } |
1344 | 1343 |
1345 {% endblock %} | 1344 {% endblock %} |
OLD | NEW |