| OLD | NEW |
| 1 {##############################################################################} | 1 {##############################################################################} |
| 2 {% macro constant_getter_callback(constant) %} | 2 {% macro constant_getter_callback(constant) %} |
| 3 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 3 static void {{constant.name}}ConstantGetterCallback(v8::Local<v8::Name>, const v
8::PropertyCallbackInfo<v8::Value>& info) |
| 4 { | 4 { |
| 5 {% if constant.deprecate_as %} | 5 {% if constant.deprecate_as %} |
| 6 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx
ecutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}}); | 6 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx
ecutionContext(info.GetIsolate()), UseCounter::{{constant.deprecate_as}}); |
| 7 {% endif %} | 7 {% endif %} |
| 8 {% if constant.measure_as %} | 8 {% if constant.measure_as %} |
| 9 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}}); | 9 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{constant.measure_as('ConstantGetter')}}); |
| 10 {% endif %} | 10 {% endif %} |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 {# Runtime-enabled constants #} | 33 {# Runtime-enabled constants #} |
| 34 {% for group in constants | runtime_enabled_constants | groupby('runtime_feature
_name') %} | 34 {% for group in constants | runtime_enabled_constants | groupby('runtime_feature
_name') %} |
| 35 {% filter runtime_enabled(group.list[0].runtime_enabled_function) %} | 35 {% filter runtime_enabled(group.list[0].runtime_enabled_function) %} |
| 36 {% for constant in group.list %} | 36 {% for constant in group.list %} |
| 37 {% set constant_name = constant.name.title().replace('_', '') %} | 37 {% set constant_name = constant.name.title().replace('_', '') %} |
| 38 const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Configu
ration = {{constant_configuration(constant)}}; | 38 const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Configu
ration = {{constant_configuration(constant)}}; |
| 39 V8DOMConfiguration::installConstant(isolate, interfaceTemplate, prototypeTemplat
e, constant{{constant_name}}Configuration); | 39 V8DOMConfiguration::installConstant(isolate, interfaceTemplate, prototypeTemplat
e, constant{{constant_name}}Configuration); |
| 40 {% endfor %} | 40 {% endfor %} |
| 41 {% endfilter %} | 41 {% endfilter %} |
| 42 {% endfor %} | 42 {% endfor %} |
| 43 {# Constants with [DeprecateAs] or [MeasureAs] or [OriginTrialEnabled] #} | 43 {# Constants with [DeprecateAs] or [MeasureAs] #} |
| 44 {% for constant in constants | has_special_getter %} | 44 {% for constant in constants | has_special_getter %} |
| 45 V8DOMConfiguration::installConstantWithGetter(isolate, interfaceTemplate, protot
ypeTemplate, "{{constant.name}}", {{cpp_class}}V8Internal::{{constant.name}}Cons
tantGetterCallback); | 45 V8DOMConfiguration::installConstantWithGetter(isolate, interfaceTemplate, protot
ypeTemplate, "{{constant.name}}", {{cpp_class}}V8Internal::{{constant.name}}Cons
tantGetterCallback); |
| 46 {% endfor %} | 46 {% endfor %} |
| 47 {# Check constants #} | 47 {# Check constants #} |
| 48 {% if not do_not_check_constants %} | 48 {% if not do_not_check_constants %} |
| 49 {% for constant in constants %} | 49 {% for constant in constants %} |
| 50 {% if constant.idl_type not in ('Double', 'Float', 'String') %} | 50 {% if constant.idl_type not in ('Double', 'Float', 'String') %} |
| 51 {% set constant_cpp_class = constant.cpp_class or cpp_class %} | 51 {% set constant_cpp_class = constant.cpp_class or cpp_class %} |
| 52 static_assert({{constant.value}} == {{constant_cpp_class}}::{{constant.reflected
_name}}, "the value of {{cpp_class}}_{{constant.reflected_name}} does not match
with implementation"); | 52 static_assert({{constant.value}} == {{constant_cpp_class}}::{{constant.reflected
_name}}, "the value of {{cpp_class}}_{{constant.reflected_name}} does not match
with implementation"); |
| 53 {% endif %} | 53 {% endif %} |
| 54 {% endfor %} | 54 {% endfor %} |
| 55 {% endif %} | 55 {% endif %} |
| 56 {% endmacro %} | 56 {% endmacro %} |
| 57 | 57 |
| 58 | 58 |
| 59 {######################################} | 59 {######################################} |
| 60 {%- macro constant_configuration(constant) %} | 60 {%- macro constant_configuration(constant) %} |
| 61 {% if constant.idl_type in ('Double', 'Float') %} | 61 {% if constant.idl_type in ('Double', 'Float') %} |
| 62 {% set value = '0, %s' % constant.value %} | 62 {% set value = '0, %s' % constant.value %} |
| 63 {% else %} | 63 {% else %} |
| 64 {# 'Short', 'Long' etc. #} | 64 {# 'Short', 'Long' etc. #} |
| 65 {% set value = '%s, 0' % constant.value %} | 65 {% set value = '%s, 0' % constant.value %} |
| 66 {% endif %} | 66 {% endif %} |
| 67 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_
type}}} | 67 {"{{constant.name}}", {{value}}, V8DOMConfiguration::ConstantType{{constant.idl_
type}}} |
| 68 {%- endmacro %} | 68 {%- endmacro %} |
| OLD | NEW |