OLD | NEW |
1 {% filter format_blink_cpp_source_code %} | 1 {% filter format_blink_cpp_source_code %} |
2 | 2 |
3 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable %} | 3 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable %} |
4 {% include 'copyright_block.txt' %} | 4 {% include 'copyright_block.txt' %} |
5 #include "{{v8_original_class}}.h" | 5 #include "{{v8_original_class}}.h" |
6 | 6 |
7 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} | 7 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} |
8 #include "{{filename}}" | 8 #include "{{filename}}" |
9 {% endfor %} | 9 {% endfor %} |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 {# Declare local variables only when the dictionary has members to avoid unuse
d variable warnings. #} | 37 {# Declare local variables only when the dictionary has members to avoid unuse
d variable warnings. #} |
38 {% if members %} | 38 {% if members %} |
39 v8::TryCatch block(isolate); | 39 v8::TryCatch block(isolate); |
40 v8::Local<v8::Object> v8Object; | 40 v8::Local<v8::Object> v8Object; |
41 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block))
{ | 41 if (!v8Call(v8Value->ToObject(isolate->GetCurrentContext()), v8Object, block))
{ |
42 exceptionState.rethrowV8Exception(block.Exception()); | 42 exceptionState.rethrowV8Exception(block.Exception()); |
43 return; | 43 return; |
44 } | 44 } |
45 {% endif %} | 45 {% endif %} |
46 {% for member in members %} | 46 {% for member in members %} |
47 {% filter runtime_enabled(member.runtime_enabled_function) %} | 47 {% filter runtime_enabled(member.runtime_enabled_feature_name) %} |
48 v8::Local<v8::Value> {{member.name}}Value; | 48 v8::Local<v8::Value> {{member.name}}Value; |
49 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "{{member.n
ame}}")).ToLocal(&{{member.name}}Value)) { | 49 if (!v8Object->Get(isolate->GetCurrentContext(), v8String(isolate, "{{member.n
ame}}")).ToLocal(&{{member.name}}Value)) { |
50 exceptionState.rethrowV8Exception(block.Exception()); | 50 exceptionState.rethrowV8Exception(block.Exception()); |
51 return; | 51 return; |
52 } | 52 } |
53 if ({{member.name}}Value.IsEmpty() || {{member.name}}Value->IsUndefined()) { | 53 if ({{member.name}}Value.IsEmpty() || {{member.name}}Value->IsUndefined()) { |
54 {% if member.is_required %} | 54 {% if member.is_required %} |
55 exceptionState.throwTypeError("required member {{member.name}} is undefined.
"); | 55 exceptionState.throwTypeError("required member {{member.name}} is undefined.
"); |
56 return; | 56 return; |
57 {% else %} | 57 {% else %} |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 129 |
130 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate
, v8::Local<v8::Value> value, ExceptionState& exceptionState) { | 130 {{cpp_class}} NativeValueTraits<{{cpp_class}}>::nativeValue(v8::Isolate* isolate
, v8::Local<v8::Value> value, ExceptionState& exceptionState) { |
131 {{cpp_class}} impl; | 131 {{cpp_class}} impl; |
132 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); | 132 {{v8_class}}::toImpl(isolate, value, impl, exceptionState); |
133 return impl; | 133 return impl; |
134 } | 134 } |
135 | 135 |
136 } // namespace blink | 136 } // namespace blink |
137 | 137 |
138 {% endfilter %}{# format_blink_cpp_source_code #} | 138 {% endfilter %}{# format_blink_cpp_source_code #} |
OLD | NEW |