Index: Source/bindings/v8/V8Binding.h |
diff --git a/Source/bindings/v8/V8Binding.h b/Source/bindings/v8/V8Binding.h |
index 7c02b3f8f91137b98e4edaaf8472a232ddf1e5c9..f33245b685d3da1ac75674daa1a56693e37ecab5 100644 |
--- a/Source/bindings/v8/V8Binding.h |
+++ b/Source/bindings/v8/V8Binding.h |
@@ -340,6 +340,32 @@ namespace WebCore { |
return toUInt8(value, NormalConversion, ok); |
} |
+ // Convert a value to a 16-bit signed integer. The conversion fails if the |
+ // value cannot be converted to a number or the range violated per WebIDL: |
+ // http://www.w3.org/TR/WebIDL/#es-short |
+ int16_t toInt16(v8::Handle<v8::Value>, IntegerConversionConfiguration, bool& ok); |
+ inline int16_t toInt16(v8::Handle<v8::Value> value, bool& ok) { return toInt16(value, NormalConversion, ok); } |
+ |
+ // Convert a value to a 16-bit integer assuming the conversion cannot fail. |
+ inline int16_t toInt16(v8::Handle<v8::Value> value) |
+ { |
+ bool ok; |
+ return toInt16(value, NormalConversion, ok); |
+ } |
+ |
+ // Convert a value to a 16-bit unsigned integer. The conversion fails if the |
+ // value cannot be converted to a number or the range violated per WebIDL: |
+ // http://www.w3.org/TR/WebIDL/#es-unsigned-short |
+ uint16_t toUInt16(v8::Handle<v8::Value>, IntegerConversionConfiguration, bool& ok); |
+ inline uint16_t toUInt16(v8::Handle<v8::Value> value, bool& ok) { return toUInt16(value, NormalConversion, ok); } |
+ |
+ // Convert a value to a 16-bit unsigned integer assuming the conversion cannot fail. |
+ inline uint16_t toUInt16(v8::Handle<v8::Value> value) |
+ { |
+ bool ok; |
+ return toUInt16(value, NormalConversion, ok); |
+ } |
+ |
// Convert a value to a 32-bit signed integer. The conversion fails if the |
// value cannot be converted to a number or the range violated per WebIDL: |
// http://www.w3.org/TR/WebIDL/#es-long |