Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp |
| index fa788f05a87ee8719f83a883275ee539675bb84e..100c161c3e1bd9c574d738d5b4c35b324b64e70f 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/V8EventListener.cpp |
| @@ -102,11 +102,19 @@ v8::Local<v8::Value> V8EventListener::callListenerFunction( |
| v8::Local<v8::Value> parameters[1] = {jsEvent}; |
| v8::Local<v8::Value> result; |
| + ScriptState* scriptStateForFunction = ScriptState::from(handlerFunction->CreationContext()); |
| + if (scriptStateForFunction->getExecutionContext() != scriptState->getExecutionContext()) |
| + scriptState->getExecutionContext()->setErrorEventScriptState(scriptStateForFunction); |
|
dominicc (has gone to gerrit)
2016/10/16 08:45:57
I think you should write a stack allocated object
Anton Obzhirov
2016/10/17 09:49:34
Yes, I was thinking about setting context as well.
|
| + |
| if (!V8ScriptRunner::callFunction(handlerFunction, frame->document(), |
| receiver, WTF_ARRAY_LENGTH(parameters), |
| parameters, scriptState->isolate()) |
| - .ToLocal(&result)) |
| + .ToLocal(&result)) { |
| + scriptState->getExecutionContext()->clearErrorEventScriptState(); |
| return v8::Local<v8::Value>(); |
| + } |
| + |
| + scriptState->getExecutionContext()->clearErrorEventScriptState(); |
| return result; |
| } |