Skip to content

Commit 5a3a419

Browse files
Fix crash on redefine class...?
1 parent 4450f09 commit 5a3a419

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Classes/JSBScriptingSupport.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ + (id)defineClass:(NSString *)declaration instanceMembers:(JSValue *)instanceMem
5555
[scanner scanUpToString:@">" intoString:&protocols];
5656

5757
className = [className stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
58+
className = [NSString stringWithFormat:@"%@$%@", className, [[[NSUUID UUID] UUIDString] stringByReplacingOccurrencesOfString:@"-" withString:@""]];
5859
parentClassName = [parentClassName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
5960
if (!parentClassName) {
6061
parentClassName = @"NSObject";

0 commit comments

Comments
 (0)