From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- .../JavaScriptCore/inspector/InjectedScriptModule.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'Source/JavaScriptCore/inspector/InjectedScriptModule.cpp') diff --git a/Source/JavaScriptCore/inspector/InjectedScriptModule.cpp b/Source/JavaScriptCore/inspector/InjectedScriptModule.cpp index f2b29d255..7e05fc90b 100644 --- a/Source/JavaScriptCore/inspector/InjectedScriptModule.cpp +++ b/Source/JavaScriptCore/inspector/InjectedScriptModule.cpp @@ -32,8 +32,6 @@ #include "config.h" #include "InjectedScriptModule.h" -#if ENABLE(INSPECTOR) - #include "InjectedScript.h" #include "InjectedScriptManager.h" #include "ScriptFunctionCall.h" @@ -56,36 +54,30 @@ void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptM ensureInjected(injectedScriptManager, injectedScript); } -void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptManager, InjectedScript injectedScript) +void InjectedScriptModule::ensureInjected(InjectedScriptManager* injectedScriptManager, const InjectedScript& injectedScript) { ASSERT(!injectedScript.hasNoValue()); if (injectedScript.hasNoValue()) return; // FIXME: Make the InjectedScript a module itself. + JSC::JSLockHolder locker(injectedScript.scriptState()); Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), ASCIILiteral("module"), injectedScriptManager->inspectorEnvironment().functionCallHandler()); function.appendArgument(name()); bool hadException = false; - Deprecated::ScriptValue resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException); + auto resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException); ASSERT(!hadException); - if (hadException || resultValue.hasNoValue() || !resultValue.isObject()) { + if (hadException || !resultValue || !resultValue.isObject()) { Deprecated::ScriptFunctionCall function(injectedScript.injectedScriptObject(), ASCIILiteral("injectModule"), injectedScriptManager->inspectorEnvironment().functionCallHandler()); function.appendArgument(name()); function.appendArgument(source()); function.appendArgument(host(injectedScriptManager, injectedScript.scriptState())); resultValue = injectedScript.callFunctionWithEvalEnabled(function, hadException); - if (hadException || (returnsObject() && (resultValue.hasNoValue() || !resultValue.isObject()))) { + if (hadException) { ASSERT_NOT_REACHED(); return; } } - - if (returnsObject()) { - Deprecated::ScriptObject moduleObject(injectedScript.scriptState(), resultValue); - initialize(moduleObject, &injectedScriptManager->inspectorEnvironment()); - } } } // namespace Inspector - -#endif // ENABLE(INSPECTOR) -- cgit v1.2.1