Java Code Examples for jdk.nashorn.api.scripting.ScriptUtils#wrap()

The following examples show how to use jdk.nashorn.api.scripting.ScriptUtils#wrap() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NashornBeansLinker.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static Object exportArgument(final Object arg, final boolean mirrorAlways) {
    if (arg instanceof ConsString) {
        return arg.toString();
    } else if (mirrorAlways && arg instanceof ScriptObject) {
        return ScriptUtils.wrap((ScriptObject)arg);
    } else {
        return arg;
    }
}
 
Example 2
Source File: NashornBeansLinker.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static Object exportArgument(final Object arg, final boolean mirrorAlways) {
    if (arg instanceof ConsString) {
        return arg.toString();
    } else if (mirrorAlways && arg instanceof ScriptObject) {
        return ScriptUtils.wrap((ScriptObject)arg);
    } else {
        return arg;
    }
}
 
Example 3
Source File: NashornBeansLinker.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static Object exportArgument(final Object arg, final boolean mirrorAlways) {
    if (arg instanceof ConsString) {
        return arg.toString();
    } else if (mirrorAlways && arg instanceof ScriptObject) {
        return ScriptUtils.wrap((ScriptObject)arg);
    } else {
        return arg;
    }
}
 
Example 4
Source File: NashornBeansLinker.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
static Object exportArgument(final Object arg, final boolean mirrorAlways) {
    if (arg instanceof ConsString) {
        return arg.toString();
    } else if (mirrorAlways && arg instanceof ScriptObject) {
        return ScriptUtils.wrap((ScriptObject)arg);
    } else {
        return arg;
    }
}
 
Example 5
Source File: NashornBeansLinker.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static Object exportArgument(final Object arg, final boolean mirrorAlways) {
    if (arg instanceof ConsString) {
        return arg.toString();
    } else if (mirrorAlways && arg instanceof ScriptObject) {
        return ScriptUtils.wrap(arg);
    } else {
        return arg;
    }
}
 
Example 6
Source File: NashornBeansLinker.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static Object exportArgument(final Object arg, final boolean mirrorAlways) {
    if (arg instanceof ConsString) {
        return arg.toString();
    } else if (mirrorAlways && arg instanceof ScriptObject) {
        return ScriptUtils.wrap((ScriptObject)arg);
    } else {
        return arg;
    }
}
 
Example 7
Source File: NashornBeansLinker.java    From jdk8u_nashorn with GNU General Public License v2.0 5 votes vote down vote up
static Object exportArgument(final Object arg, final boolean mirrorAlways) {
    if (arg instanceof ConsString) {
        return arg.toString();
    } else if (mirrorAlways && arg instanceof ScriptObject) {
        return ScriptUtils.wrap((ScriptObject)arg);
    } else {
        return arg;
    }
}
 
Example 8
Source File: NashornLinker.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unused")
private static Object createMirror(final Object obj) {
    return obj instanceof ScriptObject? ScriptUtils.wrap((ScriptObject)obj) : obj;
}
 
Example 9
Source File: NashornLinker.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unused")
private static Object createMirror(final Object obj) {
    return obj instanceof ScriptObject? ScriptUtils.wrap((ScriptObject)obj) : obj;
}
 
Example 10
Source File: NashornLinker.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unused")
private static Object createMirror(final Object obj) {
    return obj instanceof ScriptObject? ScriptUtils.wrap((ScriptObject)obj) : obj;
}
 
Example 11
Source File: NashornLinker.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unused")
private static Object createMirror(final Object obj) {
    return obj instanceof ScriptObject? ScriptUtils.wrap((ScriptObject)obj) : obj;
}
 
Example 12
Source File: NashornLinker.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unused")
private static Object createMirror(final Object obj) {
    return obj instanceof ScriptObject? ScriptUtils.wrap((ScriptObject)obj) : obj;
}
 
Example 13
Source File: NashornLinker.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unused")
private static Object createMirror(final Object obj) {
    return obj instanceof ScriptObject? ScriptUtils.wrap((ScriptObject)obj) : obj;
}
 
Example 14
Source File: NashornLinker.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unused")
private static Object createMirror(final Object obj) {
    return ScriptUtils.wrap(obj);
}
 
Example 15
Source File: NashornLinker.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unused")
private static Object createMirror(final Object obj) {
    return ScriptUtils.wrap(obj);
}
 
Example 16
Source File: NashornLinker.java    From jdk8u_nashorn with GNU General Public License v2.0 4 votes vote down vote up
@SuppressWarnings("unused")
private static Object createMirror(final Object obj) {
    return obj instanceof ScriptObject? ScriptUtils.wrap((ScriptObject)obj) : obj;
}