[skip ci] Revert "Update SharedJsScope.kt"
This reverts commit 732660469e.
This commit is contained in:
@@ -27,8 +27,7 @@ object SharedJsScope {
|
|||||||
if (scope == null) {
|
if (scope == null) {
|
||||||
val context = SCRIPT_ENGINE.getScriptContext(SimpleBindings())
|
val context = SCRIPT_ENGINE.getScriptContext(SimpleBindings())
|
||||||
scope = SCRIPT_ENGINE.getRuntimeScope(context)
|
scope = SCRIPT_ENGINE.getRuntimeScope(context)
|
||||||
Context.use {
|
Context.enter().use {
|
||||||
val context = Context.enter()
|
|
||||||
if (jsLib.isJsonObject()) {
|
if (jsLib.isJsonObject()) {
|
||||||
val jsMap: Map<String, String> = GSON.fromJson(
|
val jsMap: Map<String, String> = GSON.fromJson(
|
||||||
jsLib,
|
jsLib,
|
||||||
@@ -43,11 +42,11 @@ object SharedJsScope {
|
|||||||
val js = okHttpClient.newCallStrResponse {
|
val js = okHttpClient.newCallStrResponse {
|
||||||
url(value)
|
url(value)
|
||||||
}.body
|
}.body
|
||||||
context.evaluateString(scope, js, "jsLib", 1, null)
|
it.evaluateString(scope, js, "jsLib", 1, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
context.evaluateString(scope, jsLib, "jsLib", 1, null)
|
it.evaluateString(scope, jsLib, "jsLib", 1, null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scopeMap[key] = WeakReference(scope)
|
scopeMap[key] = WeakReference(scope)
|
||||||
@@ -55,4 +54,4 @@ object SharedJsScope {
|
|||||||
return scope
|
return scope
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user