< prev index next >
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Undefined.java
Print this page
*** 95,106 ****
final String operator = CallSiteDescriptorFactory.tokenizeOperators(desc).get(0);
switch (operator) {
case "new":
case "call": {
! final String name = desc.getNameTokenCount() > 2? desc.getNameToken(2) : null;
! final String msg = name != null? "cant.call.undefined.arg" : "cant.call.undefined";
throw typeError(msg, name);
}
case "callMethod":
throw lookupTypeError("cant.read.property.of.undefined", desc);
--- 95,106 ----
final String operator = CallSiteDescriptorFactory.tokenizeOperators(desc).get(0);
switch (operator) {
case "new":
case "call": {
! final String name = NashornCallSiteDescriptor.getFunctionDescription(desc);
! final String msg = name != null? "not.a.function" : "cant.call.undefined";
throw typeError(msg, name);
}
case "callMethod":
throw lookupTypeError("cant.read.property.of.undefined", desc);
< prev index next >