Java Code Examples for jdk.nashorn.internal.runtime.ScriptFunction#getPrototype()

The following examples show how to use jdk.nashorn.internal.runtime.ScriptFunction#getPrototype() . 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: Global.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private List<jdk.nashorn.internal.runtime.Property> extractBuiltinProperties(final String name, final ScriptObject func) {
    final List<jdk.nashorn.internal.runtime.Property> list = new ArrayList<>();

    list.addAll(Arrays.asList(func.getMap().getProperties()));

    if (func instanceof ScriptFunction) {
        final ScriptObject proto = ScriptFunction.getPrototype((ScriptFunction)func);
        if (proto != null) {
            list.addAll(Arrays.asList(proto.getMap().getProperties()));
        }
    }

    final jdk.nashorn.internal.runtime.Property prop = getProperty(name);
    if (prop != null) {
        list.add(prop);
    }

    return list;
}
 
Example 2
Source File: Global.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private List<jdk.nashorn.internal.runtime.Property> extractBuiltinProperties(final String name, final ScriptObject func) {
    final List<jdk.nashorn.internal.runtime.Property> list = new ArrayList<>();

    list.addAll(Arrays.asList(func.getMap().getProperties()));

    if (func instanceof ScriptFunction) {
        final ScriptObject proto = ScriptFunction.getPrototype((ScriptFunction)func);
        if (proto != null) {
            list.addAll(Arrays.asList(proto.getMap().getProperties()));
        }
    }

    final jdk.nashorn.internal.runtime.Property prop = getProperty(name);
    if (prop != null) {
        list.add(prop);
    }

    return list;
}
 
Example 3
Source File: Global.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getRangeErrorPrototype() {
    return ScriptFunction.getPrototype(getBuiltinRangeError());
}
 
Example 4
Source File: Global.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getFloat32ArrayPrototype() {
    return ScriptFunction.getPrototype(getBuiltinFloat32Array());
}
 
Example 5
Source File: Global.java    From nashorn with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getRangeErrorPrototype() {
    return ScriptFunction.getPrototype(builtinRangeError);
}
 
Example 6
Source File: Global.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getInt16ArrayPrototype() {
    return ScriptFunction.getPrototype(getBuiltinInt16Array());
}
 
Example 7
Source File: Global.java    From jdk8u_nashorn with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getRangeErrorPrototype() {
    return ScriptFunction.getPrototype(getBuiltinRangeError());
}
 
Example 8
Source File: Global.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getJavaImporterPrototype() {
    return ScriptFunction.getPrototype(getBuiltinJavaImporter());
}
 
Example 9
Source File: Global.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getRangeErrorPrototype() {
    return ScriptFunction.getPrototype(getBuiltinRangeError());
}
 
Example 10
Source File: Global.java    From jdk8u_nashorn with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getBooleanPrototype() {
    return ScriptFunction.getPrototype(builtinBoolean);
}
 
Example 11
Source File: Global.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getReferenceErrorPrototype() {
    return ScriptFunction.getPrototype(builtinReferenceError);
}
 
Example 12
Source File: Global.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getNumberPrototype() {
    return ScriptFunction.getPrototype(builtinNumber);
}
 
Example 13
Source File: Global.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getObjectPrototype() {
    return ScriptFunction.getPrototype(builtinObject);
}
 
Example 14
Source File: Global.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getUint16ArrayPrototype() {
    return ScriptFunction.getPrototype(getBuiltinUint16Array());
}
 
Example 15
Source File: Global.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getJavaImporterPrototype() {
    return ScriptFunction.getPrototype(getBuiltinJavaImporter());
}
 
Example 16
Source File: Global.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getSymbolPrototype() {
    return ScriptFunction.getPrototype(getBuiltinSymbol());
}
 
Example 17
Source File: Global.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getEvalErrorPrototype() {
    return ScriptFunction.getPrototype(getBuiltinEvalError());
}
 
Example 18
Source File: Global.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getNumberPrototype() {
    return ScriptFunction.getPrototype(builtinNumber);
}
 
Example 19
Source File: Global.java    From nashorn with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getFloat32ArrayPrototype() {
    return ScriptFunction.getPrototype(builtinFloat32Array);
}
 
Example 20
Source File: Global.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getUint8ArrayPrototype() {
    return ScriptFunction.getPrototype(getBuiltinUint8Array());
}