Skip to content

Commit a312e59

Browse files
rbrigbrail
authored andcommitted
add target class name to the msg text
1 parent ebad21d commit a312e59

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

rhino/src/main/java/org/mozilla/javascript/LambdaConstructor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ public void setPrototypeScriptable(ScriptableObject proto) {
445445
@SuppressWarnings("unchecked")
446446
public static <T> T convertThisObject(Scriptable thisObj, Class<T> targetClass) {
447447
if (!targetClass.isInstance(thisObj)) {
448-
throw ScriptRuntime.typeErrorById("msg.this.not.instance");
448+
throw ScriptRuntime.typeErrorById("msg.this.not.instance", targetClass.getSimpleName());
449449
}
450450
return (T) thisObj;
451451
}

rhino/src/main/resources/org/mozilla/javascript/resources/Messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ msg.constructor.no.function =\
988988
The constructor for {0} may not be invoked as a function
989989

990990
msg.this.not.instance =\
991-
\"this\" is not an instance of the class
991+
\"this\" is not an instance of class {0}
992992

993993
# Promises
994994
msg.function.expected =\

0 commit comments

Comments
 (0)