-{% if argument.enum_validation_expression %}
-{# Methods throw on invalid enum values: http://www.w3.org/TR/WebIDL/#idl-enums #}
+{# Type checking, possibly throw a TypeError, per:
+ http://www.w3.org/TR/WebIDL/#es-type-mapping #}
+{% if argument.has_type_checking_unrestricted %}
+{# Non-finite floating point values (NaN, +Infinity or −Infinity), per:
+ http://heycam.github.io/webidl/#es-float
+ http://heycam.github.io/webidl/#es-double #}
+if (!std::isfinite({{argument.name}})) {
+ {{throw_type_error(method, '"%s parameter %s is non-finite."' %
+ (argument.idl_type, argument.index + 1)) | indent}}
+ return;
+}
+{% elif argument.enum_validation_expression %}
+{# Invalid enum values: http://www.w3.org/TR/WebIDL/#idl-enums #}