OLD | NEW |
1 {##############################################################################} | 1 {##############################################################################} |
2 {% macro generate_method(method, world_suffix) %} | 2 {% macro generate_method(method, world_suffix) %} |
3 {% filter conditional(method.conditional_string) %} | 3 {% filter conditional(method.conditional_string) %} |
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
5 { | 5 { |
6 {# Local variables #} | 6 {# Local variables #} |
7 {% if method.has_exception_state %} | 7 {% if method.has_exception_state %} |
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); | 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); |
9 {% endif %} | 9 {% endif %} |
10 {% if method.number_of_required_arguments %} | 10 {% if method.number_of_required_arguments %} |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 v8SetReturnValue(info, wrapper); | 401 v8SetReturnValue(info, wrapper); |
402 } | 402 } |
403 {% endmacro %} | 403 {% endmacro %} |
404 | 404 |
405 | 405 |
406 {##############################################################################} | 406 {##############################################################################} |
407 {% macro named_constructor_callback(constructor) %} | 407 {% macro named_constructor_callback(constructor) %} |
408 static void {{v8_class}}ConstructorCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 408 static void {{v8_class}}ConstructorCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
409 { | 409 { |
410 if (!info.IsConstructCall()) { | 410 if (!info.IsConstructCall()) { |
411 throwTypeError(ExceptionMessages::failedToConstruct("{{constructor.name}
}", "Please use the 'new' operator, this DOM object constructor cannot be called
as a function."), info.GetIsolate()); | 411 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("{{co
nstructor.name}}"), info.GetIsolate()); |
412 return; | 412 return; |
413 } | 413 } |
414 | 414 |
415 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { | 415 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { |
416 v8SetReturnValue(info, info.Holder()); | 416 v8SetReturnValue(info, info.Holder()); |
417 return; | 417 return; |
418 } | 418 } |
419 | 419 |
420 Document* document = currentDOMWindow(info.GetIsolate())->document(); | 420 Document* document = currentDOMWindow(info.GetIsolate())->document(); |
421 ASSERT(document); | 421 ASSERT(document); |
(...skipping 24 matching lines...) Expand all Loading... |
446 | 446 |
447 {% if has_custom_wrap %} | 447 {% if has_custom_wrap %} |
448 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), info.GetIso
late()); | 448 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), info.GetIso
late()); |
449 {% else %} | 449 {% else %} |
450 v8::Handle<v8::Object> wrapper = info.Holder(); | 450 v8::Handle<v8::Object> wrapper = info.Holder(); |
451 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8
_class}}Constructor::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_conf
iguration}}); | 451 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8
_class}}Constructor::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_conf
iguration}}); |
452 {% endif %} | 452 {% endif %} |
453 v8SetReturnValue(info, wrapper); | 453 v8SetReturnValue(info, wrapper); |
454 } | 454 } |
455 {% endmacro %} | 455 {% endmacro %} |
OLD | NEW |