| Index: Source/bindings/core/v8/ScriptValue.h
|
| diff --git a/Source/bindings/core/v8/ScriptValue.h b/Source/bindings/core/v8/ScriptValue.h
|
| index 7ad2aecaed7c51507d12e55ea33d1dd2cecd2704..d234a9783aa9402e8eb8ed1805f85691b89b1571 100644
|
| --- a/Source/bindings/core/v8/ScriptValue.h
|
| +++ b/Source/bindings/core/v8/ScriptValue.h
|
| @@ -67,6 +67,14 @@ public:
|
| ASSERT(isEmpty() || m_scriptState);
|
| }
|
|
|
| + template <typename T>
|
| + ScriptValue(ScriptState* scriptState, v8::MaybeLocal<T> value)
|
| + : m_scriptState(scriptState)
|
| + , m_value(value.IsEmpty() ? nullptr : SharedPersistent<v8::Value>::create(value.ToLocalChecked(), scriptState->isolate()))
|
| + {
|
| + ASSERT(isEmpty() || m_scriptState);
|
| + }
|
| +
|
| ScriptValue(const ScriptValue& value)
|
| : m_scriptState(value.m_scriptState)
|
| , m_value(value.m_value)
|
| @@ -84,6 +92,12 @@ public:
|
| return m_scriptState ? m_scriptState->isolate() : v8::Isolate::GetCurrent();
|
| }
|
|
|
| + v8::Local<v8::Context> context() const
|
| + {
|
| + ASSERT(m_scriptState.get());
|
| + return m_scriptState->context();
|
| + }
|
| +
|
| ScriptValue& operator=(const ScriptValue& value)
|
| {
|
| if (this != &value) {
|
|
|