Chromium Code Reviews| Index: Source/bindings/core/v8/V8Binding.h |
| diff --git a/Source/bindings/core/v8/V8Binding.h b/Source/bindings/core/v8/V8Binding.h |
| index 9b6b2fdf371356204a539ee315c72835bd7dab68..7e9915b356402e837f257dc17ea55344529d7888 100644 |
| --- a/Source/bindings/core/v8/V8Binding.h |
| +++ b/Source/bindings/core/v8/V8Binding.h |
| @@ -387,6 +387,15 @@ enum IntegerConversionConfiguration { |
| Clamp |
| }; |
| +// Convert a value to a boolean. |
| +bool toBooleanSlow(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&); |
|
vivekg
2015/04/10 07:17:30
Should we export this symbol using CORE_EXPORT?
bashi
2015/04/10 07:25:20
Done.
|
| +inline bool toBoolean(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) |
| +{ |
| + if (LIKELY(value->IsBoolean())) |
| + return value.As<v8::Boolean>()->Value(); |
| + return toBooleanSlow(isolate, value, exceptionState); |
| +} |
| + |
| // Convert a value to a 8-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-byte |