Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix for all ObjJ methods showing up as anonymous functions in Safari …
…profiler.

[#266 state:resolved]

Reviewed by me.
  • Loading branch information
Francisco Tolmasky committed Apr 14, 2009
1 parent 831bbef commit 0e8e725
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Objective-J/runtime.js
Expand Up @@ -144,7 +144,7 @@ function class_addIvars(/*Class*/ aClass, /*Array*/ivars)
var ivar = ivars[index],
name = ivar.name;

if (typeof thePrototype[name] == "undefined")
if (typeof thePrototype[name] === "undefined")
{
aClass.ivars.push(ivar);
thePrototype[name] = NULL;
Expand All @@ -159,6 +159,8 @@ function class_copyIvarList(/*Class*/ aClass)

//#define class_copyIvarList(aClass) (aClass.ivars.slice(0))

#define METHOD_DISPLAY_NAME(aClass, aMethod) (ISMETA(aClass) ? '+' : '-') + " [" + class_getName(aClass) + ' ' + method_getName(aMethod) + ']'

function class_addMethod(/*Class*/ aClass, /*SEL*/ aName, /*IMP*/ anImplementation, /*String*/aType)
{
if (aClass.method_hash[aName])
Expand All @@ -168,10 +170,13 @@ function class_addMethod(/*Class*/ aClass, /*SEL*/ aName, /*IMP*/ anImplementati

aClass.method_list.push(method);
aClass.method_dtable[aName] = method;


// Give this function a "pretty" name for the console.
method.method_imp.displayName = METHOD_DISPLAY_NAME(aClass, method);

// FIXME: Should this be done here?
// If this is a root class...
if (!ISMETA(aClass) && GETMETA(aClass).isa == GETMETA(aClass))
if (!ISMETA(aClass) && GETMETA(aClass).isa === GETMETA(aClass))
class_addMethods(GETMETA(aClass), methods);

return YES;
Expand All @@ -194,10 +199,13 @@ function class_addMethods(/*Class*/ aClass, /*Array*/ methods)

method_list.push(method);
method_dtable[method.name] = method;

// Give this function a "pretty" name for the console.
method.method_imp.displayName = METHOD_DISPLAY_NAME(aClass, method);
}

// If this is a root class...
if (!ISMETA(aClass) && GETMETA(aClass).isa == GETMETA(aClass))
if (!ISMETA(aClass) && GETMETA(aClass).isa === GETMETA(aClass))
class_addMethods(GETMETA(aClass), methods);
}

Expand Down Expand Up @@ -520,7 +528,7 @@ function sel_getUid(/*String*/ aName)

function sel_isEqual(/*SEL*/ lhs, /*SEL*/ rhs)
{
return lhs == rhs;
return lhs === rhs;
}

function sel_registerName(aName)
Expand Down

1 comment on commit 0e8e725

@kvapil
Copy link

@kvapil kvapil commented on 0e8e725 Apr 16, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is much better

Please sign in to comment.