Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package application;
public abstract class BaseClass {
protected void base() {
System.err.println("base");
}
protected final void fbase() {
System.err.println("fbase");
}
public void run() {
System.err.println("Run it");
}
}
var BaseClass = Java.type("application.BaseClass");
var Sample = Java.extend(BaseClass);
var s = new Sample() {
run : function() {
s.base();
s.fbase();
}
};
s.run();
@tomsontom

This comment has been minimized.

Copy link
Owner Author

@tomsontom tomsontom commented Sep 20, 2014

base
javax.script.ScriptException: TypeError: application.BaseClass$$NashornJavaAdapter@429bd883 has no such function "fbase" in at line number 6
at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:586)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:570)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:525)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:521)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:187)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
at application.TestNashornX.main(TestNashornX.java:15)
Caused by: :6 TypeError: application.BaseClass$$NashornJavaAdapter@429bd883 has no such function "fbase"
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:58)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:214)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:186)
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:173)
at jdk.nashorn.internal.runtime.linker.NashornBottomLinker.linkBean(NashornBottomLinker.java:118)
at jdk.nashorn.internal.runtime.linker.NashornBottomLinker.getGuardedInvocation(NashornBottomLinker.java:73)
at jdk.internal.dynalink.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:124)
at jdk.internal.dynalink.support.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:144)
at jdk.internal.dynalink.DynamicLinker.relink(DynamicLinker.java:232)
at jdk.nashorn.internal.scripts.Script$^eval_.L:4(:6)
at application.BaseClass$$NashornJavaAdapter.run(Unknown Source)
at jdk.nashorn.internal.scripts.Script$^eval_.runScript(:10)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:535)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:209)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:378)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:568)
... 5 more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment