summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/inspector/InjectedScriptModule.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/inspector/InjectedScriptModule.cpp
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/inspector/InjectedScriptModule.cpp')
-rw-r--r--Source/JavaScriptCore/inspector/InjectedScriptModule.cpp18
1 files changed, 5 insertions, 13 deletions
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)