Skip to content

Commit fa7e69f

Browse files
committed
Use equals() instead of isInstance() when checking for redefinition
1 parent 76adbd7 commit fa7e69f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/org/mozilla/javascript/ScriptableObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ static <T extends Scriptable> BaseFunction buildClassCtor(
12981298
Object existing = getProperty(getTopLevelScope(scope), className);
12991299
if (existing instanceof BaseFunction) {
13001300
Object existingProto = ((BaseFunction)existing).getPrototypeProperty();
1301-
if (clazz.isInstance(existingProto)) {
1301+
if (clazz.equals(existingProto.getClass())) {
13021302
return (BaseFunction)existing;
13031303
}
13041304
}

0 commit comments

Comments
 (0)