| OLD | NEW |
| 1 {% extends 'interface_base.cpp' %} | 1 {% extends 'interface_base.cpp' %} |
| 2 | 2 |
| 3 {% set has_prepare_prototype_and_interface_object = | 3 {% set has_prepare_prototype_and_interface_object = |
| 4 unscopeables or has_conditional_attributes_on_prototype or | 4 unscopables or has_conditional_attributes_on_prototype or |
| 5 methods | conditionally_exposed(is_partial) %} | 5 methods | conditionally_exposed(is_partial) %} |
| 6 {% set prepare_prototype_and_interface_object_func = | 6 {% set prepare_prototype_and_interface_object_func = |
| 7 '%s::preparePrototypeAndInterfaceObject' % v8_class | 7 '%s::preparePrototypeAndInterfaceObject' % v8_class |
| 8 if has_prepare_prototype_and_interface_object | 8 if has_prepare_prototype_and_interface_object |
| 9 else 'nullptr' %} | 9 else 'nullptr' %} |
| 10 | 10 |
| 11 | 11 |
| 12 {##############################################################################} | 12 {##############################################################################} |
| 13 {% block indexed_property_getter %} | 13 {% block indexed_property_getter %} |
| 14 {% if indexed_property_getter and not indexed_property_getter.is_custom %} | 14 {% if indexed_property_getter and not indexed_property_getter.is_custom %} |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 {% endblock %} | 919 {% endblock %} |
| 920 | 920 |
| 921 | 921 |
| 922 {##############################################################################} | 922 {##############################################################################} |
| 923 {% block prepare_prototype_and_interface_object %} | 923 {% block prepare_prototype_and_interface_object %} |
| 924 {% from 'methods.cpp' import install_conditionally_enabled_methods with context
%} | 924 {% from 'methods.cpp' import install_conditionally_enabled_methods with context
%} |
| 925 {% if has_prepare_prototype_and_interface_object %} | 925 {% if has_prepare_prototype_and_interface_object %} |
| 926 void {{v8_class}}::preparePrototypeAndInterfaceObject(v8::Local<v8::Context> con
text, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeObject, v8::L
ocal<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTem
plate) | 926 void {{v8_class}}::preparePrototypeAndInterfaceObject(v8::Local<v8::Context> con
text, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeObject, v8::L
ocal<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTem
plate) |
| 927 { | 927 { |
| 928 v8::Isolate* isolate = context->GetIsolate(); | 928 v8::Isolate* isolate = context->GetIsolate(); |
| 929 {% if unscopeables %} | 929 {% if unscopables %} |
| 930 {{install_unscopeables() | indent}} | 930 {{install_unscopables() | indent}} |
| 931 {% endif %} | 931 {% endif %} |
| 932 {% if has_conditional_attributes_on_prototype %} | 932 {% if has_conditional_attributes_on_prototype %} |
| 933 {{install_conditionally_enabled_attributes_on_prototype() | indent}} | 933 {{install_conditionally_enabled_attributes_on_prototype() | indent}} |
| 934 {% endif %} | 934 {% endif %} |
| 935 {% if methods | conditionally_exposed(is_partial) %} | 935 {% if methods | conditionally_exposed(is_partial) %} |
| 936 {{install_conditionally_enabled_methods() | indent}} | 936 {{install_conditionally_enabled_methods() | indent}} |
| 937 {% endif %} | 937 {% endif %} |
| 938 } | 938 } |
| 939 | 939 |
| 940 {% endif %} | 940 {% endif %} |
| 941 {% endblock %} | 941 {% endblock %} |
| 942 | 942 |
| 943 | 943 |
| 944 {##############################################################################} | 944 {##############################################################################} |
| 945 {% macro install_unscopeables() %} | 945 {% macro install_unscopables() %} |
| 946 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); | 946 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); |
| 947 v8::Local<v8::Object> unscopeables; | 947 v8::Local<v8::Object> unscopables; |
| 948 if (v8CallBoolean(prototypeObject->HasOwnProperty(context, unscopablesSymbol))) | 948 if (v8CallBoolean(prototypeObject->HasOwnProperty(context, unscopablesSymbol))) |
| 949 unscopeables = prototypeObject->Get(context, unscopablesSymbol).ToLocalCheck
ed().As<v8::Object>(); | 949 unscopables = prototypeObject->Get(context, unscopablesSymbol).ToLocalChecke
d().As<v8::Object>(); |
| 950 else | 950 else |
| 951 unscopeables = v8::Object::New(isolate); | 951 unscopables = v8::Object::New(isolate); |
| 952 {% for name, runtime_enabled_function in unscopeables %} | 952 {% for name, runtime_enabled_function in unscopables %} |
| 953 {% filter runtime_enabled(runtime_enabled_function) %} | 953 {% filter runtime_enabled(runtime_enabled_function) %} |
| 954 unscopeables->CreateDataProperty(context, v8AtomicString(isolate, "{{name}}"), v
8::True(isolate)).FromJust(); | 954 unscopables->CreateDataProperty(context, v8AtomicString(isolate, "{{name}}"), v8
::True(isolate)).FromJust(); |
| 955 {% endfilter %} | 955 {% endfilter %} |
| 956 {% endfor %} | 956 {% endfor %} |
| 957 prototypeObject->CreateDataProperty(context, unscopablesSymbol, unscopeables).Fr
omJust(); | 957 prototypeObject->CreateDataProperty(context, unscopablesSymbol, unscopables).Fro
mJust(); |
| 958 {% endmacro %} | 958 {% endmacro %} |
| 959 | 959 |
| 960 | 960 |
| 961 {##############################################################################} | 961 {##############################################################################} |
| 962 {% macro install_conditionally_enabled_attributes_on_prototype() %} | 962 {% macro install_conditionally_enabled_attributes_on_prototype() %} |
| 963 {% from 'attributes.cpp' import attribute_configuration with context %} | 963 {% from 'attributes.cpp' import attribute_configuration with context %} |
| 964 ExecutionContext* executionContext = toExecutionContext(context); | 964 ExecutionContext* executionContext = toExecutionContext(context); |
| 965 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTempla
te); | 965 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTempla
te); |
| 966 {% for attribute in attributes if (attribute.exposed_test or attribute.secure_co
ntext_test) and attribute.on_prototype %} | 966 {% for attribute in attributes if (attribute.exposed_test or attribute.secure_co
ntext_test) and attribute.on_prototype %} |
| 967 {% filter exposed(attribute.exposed_test) %} | 967 {% filter exposed(attribute.exposed_test) %} |
| (...skipping 22 matching lines...) Expand all Loading... |
| 990 | 990 |
| 991 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} | 991 {% for method in methods if method.overloads and method.overloads.has_partial_ov
erloads %} |
| 992 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) | 992 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt
erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) |
| 993 { | 993 { |
| 994 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; | 994 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; |
| 995 } | 995 } |
| 996 | 996 |
| 997 {% endfor %} | 997 {% endfor %} |
| 998 {% endif %} | 998 {% endif %} |
| 999 {% endblock %} | 999 {% endblock %} |
| OLD | NEW |