diff options
Diffstat (limited to 'WebCore/bindings/js/JSDOMBinding.h')
-rw-r--r-- | WebCore/bindings/js/JSDOMBinding.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/WebCore/bindings/js/JSDOMBinding.h b/WebCore/bindings/js/JSDOMBinding.h index 749b0d7..f0bd2e2 100644 --- a/WebCore/bindings/js/JSDOMBinding.h +++ b/WebCore/bindings/js/JSDOMBinding.h @@ -267,6 +267,13 @@ namespace WebCore { String valueToStringWithNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null String valueToStringWithUndefinedOrNullCheck(JSC::ExecState*, JSC::JSValue); // null if the value is null or undefined + inline int32_t finiteInt32Value(JSC::JSValue value, JSC::ExecState* exec, bool& okay) + { + double number = value.toNumber(exec); + okay = isfinite(number); + return JSC::toInt32(number); + } + // Returns a Date instance for the specified value, or null if the value is NaN or infinity. JSC::JSValue jsDateOrNull(JSC::ExecState*, double); // NaN if the value can't be converted to a date. |