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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 {##############################################################################} | 813 {##############################################################################} |
814 {% block constructor_callback %} | 814 {% block constructor_callback %} |
815 {% if constructors or has_custom_constructor or has_event_constructor %} | 815 {% if constructors or has_custom_constructor or has_event_constructor %} |
816 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 816 void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
817 { | 817 { |
818 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); | 818 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); |
819 {% if measure_as %} | 819 {% if measure_as %} |
820 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
measure_as}}); | 820 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
measure_as}}); |
821 {% endif %} | 821 {% endif %} |
822 if (!info.IsConstructCall()) { | 822 if (!info.IsConstructCall()) { |
823 throwTypeError(ExceptionMessages::failedToConstruct("{{interface_name}}"
, "Please use the 'new' operator, this DOM object constructor cannot be called a
s a function."), info.GetIsolate()); | 823 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("{{in
terface_name}}"), info.GetIsolate()); |
824 return; | 824 return; |
825 } | 825 } |
826 | 826 |
827 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { | 827 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { |
828 v8SetReturnValue(info, info.Holder()); | 828 v8SetReturnValue(info, info.Holder()); |
829 return; | 829 return; |
830 } | 830 } |
831 | 831 |
832 {% if has_custom_constructor %} | 832 {% if has_custom_constructor %} |
833 {{v8_class}}::constructorCustom(info); | 833 {{v8_class}}::constructorCustom(info); |
(...skipping 481 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 |