Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(194)

Unified Diff: Source/bindings/templates/methods.cpp

Issue 1132243004: IDL: Determine maximum distinguishing argument index runtime, if needed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/templates/interface_base.cpp ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/methods.cpp
diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
index 04dc25ea91b30221b73e2b42e669c92f83e86c65..a8a4f124a277ef7f77602b1ce1a2a860950f1c9a 100644
--- a/Source/bindings/templates/methods.cpp
+++ b/Source/bindings/templates/methods.cpp
@@ -352,6 +352,21 @@ static int {{overloads.name}}MethodLength()
{##############################################################################}
+{% macro runtime_determined_maxarg_method(overloads) %}
+static int {{overloads.name}}MethodMaxArg()
+{
+ {% for length, runtime_enabled_functions in overloads.runtime_determined_maxargs %}
+ {% for runtime_enabled_function in runtime_enabled_functions %}
+ {% filter runtime_enabled(runtime_enabled_function) %}
+ return {{length}};
+ {% endfilter %}
+ {% endfor %}
+ {% endfor %}
+}
+{% endmacro %}
+
+
+{##############################################################################}
{# FIXME: We should return a rejected Promise if an error occurs in this
function when ALL methods in this overload return Promise. In order to do so,
we must ensure either ALL or NO methods in this overload return Promise #}
@@ -401,7 +416,7 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI
{# Invalid arity, throw error #}
{# Report full list of valid arities if gaps and above minimum #}
{% if overloads.valid_arities %}
- if (info.Length() >= {{overloads.minarg}}) {
+ if (info.Length() >= {{overloads.length}}) {
setArityTypeError(exceptionState, "{{overloads.valid_arities}}", info.Length());
{{propagate_error_with_exception_state(overloads) | indent(12)}}
}
« no previous file with comments | « Source/bindings/templates/interface_base.cpp ('k') | Source/bindings/tests/idls/core/TestObject.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698