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

The following examples show how to use jdk.nashorn.internal.runtime.ScriptFunction#getPrototype() . These examples are extracted from open source projects. 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
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
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
ScriptObject getObjectPrototype() {
    return ScriptFunction.getPrototype(builtinObject);
}
 
Example 4
ScriptObject getUint8ArrayPrototype() {
    return ScriptFunction.getPrototype(getBuiltinUint8Array());
}
 
Example 5
Source Project: nashorn   File: Global.java    License: GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getFloat32ArrayPrototype() {
    return ScriptFunction.getPrototype(builtinFloat32Array);
}
 
Example 6
ScriptObject getNumberPrototype() {
    return ScriptFunction.getPrototype(builtinNumber);
}
 
Example 7
ScriptObject getEvalErrorPrototype() {
    return ScriptFunction.getPrototype(getBuiltinEvalError());
}
 
Example 8
ScriptObject getSymbolPrototype() {
    return ScriptFunction.getPrototype(getBuiltinSymbol());
}
 
Example 9
ScriptObject getJavaImporterPrototype() {
    return ScriptFunction.getPrototype(getBuiltinJavaImporter());
}
 
Example 10
ScriptObject getUint16ArrayPrototype() {
    return ScriptFunction.getPrototype(getBuiltinUint16Array());
}
 
Example 11
ScriptObject getRangeErrorPrototype() {
    return ScriptFunction.getPrototype(getBuiltinRangeError());
}
 
Example 12
ScriptObject getNumberPrototype() {
    return ScriptFunction.getPrototype(builtinNumber);
}
 
Example 13
ScriptObject getReferenceErrorPrototype() {
    return ScriptFunction.getPrototype(builtinReferenceError);
}
 
Example 14
ScriptObject getBooleanPrototype() {
    return ScriptFunction.getPrototype(builtinBoolean);
}
 
Example 15
ScriptObject getRangeErrorPrototype() {
    return ScriptFunction.getPrototype(getBuiltinRangeError());
}
 
Example 16
ScriptObject getJavaImporterPrototype() {
    return ScriptFunction.getPrototype(getBuiltinJavaImporter());
}
 
Example 17
ScriptObject getRangeErrorPrototype() {
    return ScriptFunction.getPrototype(getBuiltinRangeError());
}
 
Example 18
ScriptObject getInt16ArrayPrototype() {
    return ScriptFunction.getPrototype(getBuiltinInt16Array());
}
 
Example 19
Source Project: nashorn   File: Global.java    License: GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getRangeErrorPrototype() {
    return ScriptFunction.getPrototype(builtinRangeError);
}
 
Example 20
Source Project: hottub   File: Global.java    License: GNU General Public License v2.0 4 votes vote down vote up
ScriptObject getFloat32ArrayPrototype() {
    return ScriptFunction.getPrototype(getBuiltinFloat32Array());
}