mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 04:59:05 +00:00
Made JS parameters expecting String universally compatible with all types
This commit is contained in:
1 parent
ff81281337
commit
0bc6751914
1 file changed
+5
@@ -48,6 +48,11 @@ public final class TypeChecker {
|
||||
// Treat java.lang.Object as "any", universally compatible
|
||||
if ("Object".equals(expected.getSimpleName()) || "Object".equals(actual.getSimpleName()) )
|
||||
return true;
|
||||
|
||||
// Treat String as universally compatible, since JavaScript string literals can be assigned to String
|
||||
// parameters and String is commonly used as a catch-all type in JS APIs
|
||||
if("String".equals(expected.getSimpleName()))
|
||||
return true;
|
||||
}
|
||||
|
||||
// Handle null literal - null is compatible with any reference type (non-primitive)
|
||||
|
||||
Reference in new issue
Block a user