From 47d3c45449f2212a2d0ba811c76d1f6e1696726a Mon Sep 17 00:00:00 2001 From: Horis <8674809+821938089@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:24:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/script/rhino/RhinoScriptEngine.kt | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/modules/rhino/src/main/java/com/script/rhino/RhinoScriptEngine.kt b/modules/rhino/src/main/java/com/script/rhino/RhinoScriptEngine.kt index a50436bd1..64a87664d 100644 --- a/modules/rhino/src/main/java/com/script/rhino/RhinoScriptEngine.kt +++ b/modules/rhino/src/main/java/com/script/rhino/RhinoScriptEngine.kt @@ -24,16 +24,38 @@ */ package com.script.rhino -import com.script.* +import com.script.AbstractScriptEngine +import com.script.Bindings +import com.script.Compilable +import com.script.CompiledScript +import com.script.Invocable +import com.script.ScriptBindings +import com.script.ScriptContext +import com.script.ScriptException +import com.script.SimpleBindings import kotlinx.coroutines.asContextElement import kotlinx.coroutines.withContext -import org.mozilla.javascript.* +import org.mozilla.javascript.Callable +import org.mozilla.javascript.ConsString +import org.mozilla.javascript.Context +import org.mozilla.javascript.ContextFactory +import org.mozilla.javascript.ContinuationPending import org.mozilla.javascript.Function +import org.mozilla.javascript.JavaScriptException +import org.mozilla.javascript.RhinoException +import org.mozilla.javascript.Scriptable +import org.mozilla.javascript.ScriptableObject +import org.mozilla.javascript.Undefined +import org.mozilla.javascript.Wrapper import java.io.IOException import java.io.Reader import java.io.StringReader import java.lang.reflect.Method -import java.security.* +import java.security.AccessControlContext +import java.security.AccessControlException +import java.security.AccessController +import java.security.AllPermission +import java.security.PrivilegedAction import kotlin.coroutines.Continuation import kotlin.coroutines.CoroutineContext import kotlin.coroutines.intrinsics.suspendCoroutineUninterceptedOrReturn @@ -305,6 +327,9 @@ object RhinoScriptEngine : AbstractScriptEngine(), Invocable, Compilable { if (result1 is Wrapper) { result1 = result1.unwrap() } + if (result1 is ConsString) { + result1 = result1.toString() + } return if (result1 is Undefined) null else result1 }