Chromium Code Reviews| Index: Source/bindings/core/v8/ScriptValue.h |
| diff --git a/Source/bindings/core/v8/ScriptValue.h b/Source/bindings/core/v8/ScriptValue.h |
| index ca543728397bfa153f717b246367ab07a5b15eb2..f1b220b1b9c1cd374727789cd720562084b9f7e3 100644 |
| --- a/Source/bindings/core/v8/ScriptValue.h |
| +++ b/Source/bindings/core/v8/ScriptValue.h |
| @@ -41,8 +41,12 @@ |
| namespace blink { |
| +class ExceptionState; |
| class JSONValue; |
| +template <typename T> |
| +T script_value_cast(const v8::Local<v8::Value>&, v8::Isolate*, ExceptionState&); |
| + |
| class CORE_EXPORT ScriptValue final { |
| public: |
| template<typename T> |
| @@ -51,6 +55,12 @@ public: |
| return ScriptValue(scriptState, toV8(value, scriptState->context()->Global(), scriptState->isolate())); |
| } |
| + template<typename T> |
| + T to(ExceptionState& exceptionState) const |
| + { |
| + return script_value_cast<T>(v8Value(), isolate(), exceptionState); |
|
haraken
2015/03/14 01:27:19
I'm wondering why we cannot simply call:
Native
|
| + } |
| + |
| ScriptValue() { } |
| ScriptValue(ScriptState* scriptState, v8::Handle<v8::Value> value) |