< prev index next >

src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java

Print this page

        

*** 1857,1867 **** * @param request The link request * * @return GuardedInvocation to be invoked at call site. */ protected GuardedInvocation findNewMethod(final CallSiteDescriptor desc, final LinkRequest request) { ! return notAFunction(); } /** * Find the appropriate CALL method for an invoke dynamic call. * This generates "not a function" always --- 1857,1867 ---- * @param request The link request * * @return GuardedInvocation to be invoked at call site. */ protected GuardedInvocation findNewMethod(final CallSiteDescriptor desc, final LinkRequest request) { ! return notAFunction(desc); } /** * Find the appropriate CALL method for an invoke dynamic call. * This generates "not a function" always
*** 1870,1884 **** * @param request the link request * * @return GuardedInvocation to be invoked at call site. */ protected GuardedInvocation findCallMethod(final CallSiteDescriptor desc, final LinkRequest request) { ! return notAFunction(); } ! private GuardedInvocation notAFunction() { ! throw typeError("not.a.function", ScriptRuntime.safeToString(this)); } /** * Find an implementation for a "dyn:callMethod" operation. Note that Nashorn internally never uses * "dyn:callMethod", but instead always emits two call sites in bytecode, one for "dyn:getMethod", and then another --- 1870,1884 ---- * @param request the link request * * @return GuardedInvocation to be invoked at call site. */ protected GuardedInvocation findCallMethod(final CallSiteDescriptor desc, final LinkRequest request) { ! return notAFunction(desc); } ! private GuardedInvocation notAFunction(final CallSiteDescriptor desc) { ! throw typeError("not.a.function", NashornCallSiteDescriptor.getFunctionErrorMessage(desc, this)); } /** * Find an implementation for a "dyn:callMethod" operation. Note that Nashorn internally never uses * "dyn:callMethod", but instead always emits two call sites in bytecode, one for "dyn:getMethod", and then another
< prev index next >