Commit 6e8f53e3 authored by yukishiino's avatar yukishiino Committed by Commit bot

Removes abuse of createClosure() from ScriptPromiseTest.

createClosure() is abused in ScriptPromise{,Resolver}Test,
so, simply removes it.

BUG=626266

Review-Url: https://codereview.chromium.org/2144413004
Cr-Commit-Position: refs/heads/master@{#407109}
parent c75de112
...@@ -18,8 +18,6 @@ namespace blink { ...@@ -18,8 +18,6 @@ namespace blink {
namespace { namespace {
void callback(const v8::FunctionCallbackInfo<v8::Value>& info) { }
class Function : public ScriptFunction { class Function : public ScriptFunction {
public: public:
static v8::Local<v8::Function> createFunction(ScriptState* scriptState, String* value) static v8::Local<v8::Function> createFunction(ScriptState* scriptState, String* value)
...@@ -54,11 +52,6 @@ public: ...@@ -54,11 +52,6 @@ public:
~ScriptPromiseResolverTest() override ~ScriptPromiseResolverTest() override
{ {
ScriptState::Scope scope(getScriptState());
// FIXME: We put this statement here to clear an exception from the
// isolate.
createClosure(callback, v8::Undefined(isolate()), isolate());
// Execute all pending microtasks // Execute all pending microtasks
v8::MicrotasksScope::PerformCheckpoint(isolate()); v8::MicrotasksScope::PerformCheckpoint(isolate());
} }
......
...@@ -46,8 +46,6 @@ namespace { ...@@ -46,8 +46,6 @@ namespace {
typedef ScriptPromise::InternalResolver Resolver; typedef ScriptPromise::InternalResolver Resolver;
void callback(const v8::FunctionCallbackInfo<v8::Value>& info) { }
class Function : public ScriptFunction { class Function : public ScriptFunction {
public: public:
static v8::Local<v8::Function> createFunction(ScriptState* scriptState, ScriptValue* output) static v8::Local<v8::Function> createFunction(ScriptState* scriptState, ScriptValue* output)
...@@ -83,9 +81,6 @@ public: ...@@ -83,9 +81,6 @@ public:
~TryCatchScope() ~TryCatchScope()
{ {
// FIXME: We put this statement here to clear an exception from the isolate.
createClosure(callback, v8::Undefined(m_isolate), m_isolate);
// Execute all pending microtasks // Execute all pending microtasks
v8::MicrotasksScope::PerformCheckpoint(m_isolate); v8::MicrotasksScope::PerformCheckpoint(m_isolate);
} }
......
...@@ -82,6 +82,11 @@ Document& V8TestingScope::document() ...@@ -82,6 +82,11 @@ Document& V8TestingScope::document()
V8TestingScope::~V8TestingScope() V8TestingScope::~V8TestingScope()
{ {
// TODO(yukishiino): We put this statement here to clear an exception from
// the isolate. Otherwise, the leak detector complains. Really mysterious
// hack.
v8::Function::New(context(), nullptr);
if (m_holder->document().frame()) if (m_holder->document().frame())
getScriptState()->disposePerContextData(); getScriptState()->disposePerContextData();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment