Fixed: When creating a method the function name can't start with '0_'

This commit is contained in:
Martin Carlberg committed 2021-09-15 17:28:07 +02:00
1 parent 3f8821b43b
commit 8257632706
1 file changed
+1 -1
+1 -1
View File
@@ -81,7 +81,7 @@ GLOBAL(objj_class) = function(displayName)
#if DEBUG
// Naming the allocator allows the WebKit heap snapshot tool to display object class names correctly
// HACK: displayName property is not respected so we must eval a function to name it
eval("this.allocator = function " + (displayName || "OBJJ_OBJECT").replace(/\W/g, "_") + "() { }");
eval("this.allocator = function " + (displayName ? displayName.replace(/^0|\W/g, "_") : "OBJJ_OBJECT") + "() { }");
#else
this.allocator = function() { };
#endif