nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterServices.java
changeset 27099 eceb216332cb
parent 26068 5488f52c2788
child 35330 7cc832bade3c
equal deleted inserted replaced
27098:2875b30458d3 27099:eceb216332cb
    45 import java.security.SecureClassLoader;
    45 import java.security.SecureClassLoader;
    46 import jdk.internal.org.objectweb.asm.ClassWriter;
    46 import jdk.internal.org.objectweb.asm.ClassWriter;
    47 import jdk.internal.org.objectweb.asm.Opcodes;
    47 import jdk.internal.org.objectweb.asm.Opcodes;
    48 import jdk.internal.org.objectweb.asm.Type;
    48 import jdk.internal.org.objectweb.asm.Type;
    49 import jdk.internal.org.objectweb.asm.commons.InstructionAdapter;
    49 import jdk.internal.org.objectweb.asm.commons.InstructionAdapter;
    50 import jdk.nashorn.api.scripting.ScriptUtils;
       
    51 import jdk.nashorn.internal.runtime.Context;
    50 import jdk.nashorn.internal.runtime.Context;
    52 import jdk.nashorn.internal.runtime.ScriptFunction;
    51 import jdk.nashorn.internal.runtime.ScriptFunction;
    53 import jdk.nashorn.internal.runtime.ScriptObject;
    52 import jdk.nashorn.internal.runtime.ScriptObject;
    54 import jdk.nashorn.internal.runtime.ScriptRuntime;
    53 import jdk.nashorn.internal.runtime.ScriptRuntime;
    55 import jdk.nashorn.internal.runtime.Undefined;
    54 import jdk.nashorn.internal.runtime.Undefined;
   218      * by the callers. Currently only transforms {@code ConsString} into {@code String} and transforms {@code ScriptObject} into {@code ScriptObjectMirror}.
   217      * by the callers. Currently only transforms {@code ConsString} into {@code String} and transforms {@code ScriptObject} into {@code ScriptObjectMirror}.
   219      * @param obj the return value
   218      * @param obj the return value
   220      * @return the filtered return value.
   219      * @return the filtered return value.
   221      */
   220      */
   222     public static Object exportReturnValue(final Object obj) {
   221     public static Object exportReturnValue(final Object obj) {
   223         return ScriptUtils.wrap(NashornBeansLinker.exportArgument(obj));
   222         return NashornBeansLinker.exportArgument(obj, true);
   224     }
   223     }
   225 
   224 
   226     /**
   225     /**
   227      * Invoked to convert a return value of a delegate function to primitive char. There's no suitable conversion in
   226      * Invoked to convert a return value of a delegate function to primitive char. There's no suitable conversion in
   228      * {@code JSType}, so we provide our own to adapters.
   227      * {@code JSType}, so we provide our own to adapters.