| Index: Source/bindings/templates/methods.cpp
|
| diff --git a/Source/bindings/templates/methods.cpp b/Source/bindings/templates/methods.cpp
|
| index c2381da54f8d37c4aeebbf800f8ce08a4e6f6db6..7ea9ce8092fa7242a1229419e3ec68cc4b320d80 100644
|
| --- a/Source/bindings/templates/methods.cpp
|
| +++ b/Source/bindings/templates/methods.cpp
|
| @@ -16,7 +16,15 @@ static void {{method.name}}Method(const v8::FunctionCallbackInfo<v8::Value>& arg
|
| return;
|
| }
|
| {% endif %}
|
| - {% if argument.idl_type == 'SerializedScriptValue' %}
|
| + {% if argument.is_clamp %}
|
| + {# FIXME: use C++ type for local variable #}
|
| + {{argument.idl_type}} {{argument.name}} = 0;
|
| + V8TRYCATCH_VOID(double, {{argument.name}}NativeValue, args[{{argument.index}}]->NumberValue());
|
| + if (!std::isnan({{argument.name}}NativeValue))
|
| + {# IDL type is used for clamping - to get the right bounds - since
|
| + different IDL types have same internal C++ type (int or unsigned) #}
|
| + {{argument.name}} = clampTo<{{argument.idl_type}}>({{argument.name}}NativeValue);
|
| + {% elif argument.idl_type == 'SerializedScriptValue' %}
|
| bool {{argument.name}}DidThrow = false;
|
| {{argument.cpp_type}} {{argument.name}} = SerializedScriptValue::create(args[{{argument.index}}], 0, 0, {{argument.name}}DidThrow, args.GetIsolate());
|
| if ({{argument.name}}DidThrow)
|
|
|