Index: Source/bindings/templates/methods.cpp |
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp |
index 41e2088c9f259ead4719804715432099b599c090..a75a7154c5bcd425fc3b8b34fc6bc129c66b937d 100644 |
--- a/Source/bindings/templates/methods.cpp |
+++ b/Source/bindings/templates/methods.cpp |
@@ -411,6 +411,16 @@ static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall |
{##############################################################################} |
+{% macro method_length(method) %} |
+{% if method.overloads %} |
+{{method.overloads.minarg}} |
Jens Widell
2014/06/02 08:46:43
This is of course possibly incorrect if the "short
Nils Barth (inactive)
2014/06/04 07:22:02
Good catch!
I assume this can't be fixed without g
Jens Widell
2014/06/04 07:38:36
I guess we could generate a simple per-method help
Nils Barth (inactive)
2014/06/04 08:12:01
More seriously, the issue of implementing JS prope
|
+{%- else %} |
+{{method.number_of_required_or_variadic_arguments}} |
Jens Widell
2014/05/27 12:11:21
This value is actually wrong per spec. It counts a
jsbell
2014/05/27 18:10:50
IMHO, we might as well fix it. (If not, we should
|
+{%- endif %} |
+{% endmacro %} |
+ |
+ |
+{##############################################################################} |
{% macro origin_safe_method_getter(method, world_suffix) %} |
static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::PropertyCallbackInfo<v8::Value>& info) |
{ |
@@ -421,7 +431,7 @@ static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop |
static int domTemplateKey; // This address is used for a key to look up the dom template. |
V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
{# FIXME: 1 case of [DoNotCheckSignature] in Window.idl may differ #} |
- v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTemplateKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), {{signature}}, {{method.number_of_required_or_variadic_arguments}}); |
+ v8::Handle<v8::FunctionTemplate> privateTemplate = data->domTemplate(&domTemplateKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), {{signature}}, {{method_length(method)}}); |
v8::Handle<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(info.This(), isolate); |
if (holder.IsEmpty()) { |
@@ -433,7 +443,7 @@ static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop |
{{cpp_class}}* impl = {{v8_class}}::toNative(holder); |
if (!BindingSecurity::shouldAllowAccessToFrame(isolate, impl->frame(), DoNotReportSecurityError)) { |
static int sharedTemplateKey; // This address is used for a key to look up the dom template. |
- v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sharedTemplateKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), {{signature}}, {{method.number_of_required_or_variadic_arguments}}); |
+ v8::Handle<v8::FunctionTemplate> sharedTemplate = data->domTemplate(&sharedTemplateKey, {{cpp_class}}V8Internal::{{method.name}}MethodCallback{{world_suffix}}, v8Undefined(), {{signature}}, {{method_length(method)}}); |
v8SetReturnValue(info, sharedTemplate->GetFunction()); |
return; |
} |