summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/V8Binding.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/V8Binding.h')
-rw-r--r--WebCore/bindings/v8/V8Binding.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/WebCore/bindings/v8/V8Binding.h b/WebCore/bindings/v8/V8Binding.h
index 0be0ebd..696cd1a 100644
--- a/WebCore/bindings/v8/V8Binding.h
+++ b/WebCore/bindings/v8/V8Binding.h
@@ -108,6 +108,17 @@ namespace WebCore {
return toInt32(value, ok);
}
+ // Convert a value to a 32-bit unsigned integer. The conversion fails if the
+ // value cannot be converted to an unsigned integer or converts to nan or to an infinity.
+ uint32_t toUInt32(v8::Handle<v8::Value> value, bool& ok);
+
+ // Convert a value to a 32-bit unsigned integer assuming the conversion cannot fail.
+ inline uint32_t toUInt32(v8::Handle<v8::Value> value)
+ {
+ bool ok;
+ return toUInt32(value, ok);
+ }
+
inline float toFloat(v8::Local<v8::Value> value)
{
return static_cast<float>(value->NumberValue());