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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 {{cpp_class}}V8Internal::indexedPropertyDeleter(index, info); | 266 {{cpp_class}}V8Internal::indexedPropertyDeleter(index, info); |
267 {% endif %} | 267 {% endif %} |
268 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 268 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
269 } | 269 } |
270 | 270 |
271 {% endif %} | 271 {% endif %} |
272 {% endblock %} | 272 {% endblock %} |
273 | 273 |
274 | 274 |
275 {##############################################################################} | 275 {##############################################################################} |
276 {% from 'methods.cpp' import union_type_method_call %} | 276 {% from 'methods.cpp' import union_type_method_call_and_set_return_value %} |
277 {% block named_property_getter %} | 277 {% block named_property_getter %} |
278 {% if named_property_getter and not named_property_getter.is_custom %} | 278 {% if named_property_getter and not named_property_getter.is_custom %} |
279 {% set getter = named_property_getter %} | 279 {% set getter = named_property_getter %} |
280 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 280 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
281 { | 281 { |
282 {% if not is_override_builtins %} | 282 {% if not is_override_builtins %} |
283 if (info.Holder()->HasRealNamedProperty(name)) | 283 if (info.Holder()->HasRealNamedProperty(name)) |
284 return; | 284 return; |
285 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 285 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
286 return; | 286 return; |
287 | 287 |
288 {% endif %} | 288 {% endif %} |
289 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder()); | 289 {{cpp_class}}* impl = {{v8_class}}::toNative(info.Holder()); |
290 AtomicString propertyName = toCoreAtomicString(name); | 290 AtomicString propertyName = toCoreAtomicString(name); |
291 {% if getter.is_raises_exception %} | 291 {% if getter.is_raises_exception %} |
292 v8::String::Utf8Value namedProperty(name); | 292 v8::String::Utf8Value namedProperty(name); |
293 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"{{interface_name}}", info.Holder(), info.GetIsolate()); | 293 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"{{interface_name}}", info.Holder(), info.GetIsolate()); |
294 {% endif %} | 294 {% endif %} |
295 {% if getter.union_arguments %} | 295 {% if getter.union_arguments %} |
296 {{union_type_method_call(getter) | indent}} | 296 {{union_type_method_call_and_set_return_value(getter) | indent}} |
297 {% else %} | 297 {% else %} |
298 {{getter.cpp_type}} result = {{getter.cpp_value}}; | 298 {{getter.cpp_type}} result = {{getter.cpp_value}}; |
299 {% if getter.is_raises_exception %} | 299 {% if getter.is_raises_exception %} |
300 if (exceptionState.throwIfNeeded()) | 300 if (exceptionState.throwIfNeeded()) |
301 return; | 301 return; |
302 {% endif %} | 302 {% endif %} |
303 if ({{getter.is_null_expression}}) | 303 if ({{getter.is_null_expression}}) |
304 return; | 304 return; |
305 {{getter.v8_set_return_value}}; | 305 {{getter.v8_set_return_value}}; |
306 {% endif %} | 306 {% endif %} |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 {% endfilter %} | 1317 {% endfilter %} |
1318 } | 1318 } |
1319 | 1319 |
1320 template<> | 1320 template<> |
1321 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 1321 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
1322 { | 1322 { |
1323 return toV8(impl, creationContext, isolate); | 1323 return toV8(impl, creationContext, isolate); |
1324 } | 1324 } |
1325 | 1325 |
1326 {% endblock %} | 1326 {% endblock %} |
OLD | NEW |