See the demo script at http://help.arcgis.com/en/webapi/jav...ind_popup.html and put a Firebug breakpoint on line 91:

Code:
var feature = result.feature;
feature.attributes.layerName = result.layerName;
feature.attributes should return the attributes of the feature, but instead it returns the aliases:

Click image for larger version

Name:	Screen Shot 2012-04-26 at 3.55.44 PM.png
Views:	25
Size:	16.9 KB
ID:	13827

This is a crucial distinction since the attributes are guaranteed to be unique whereas the aliases may not be.

Ideally, feature.attributes should return the attributes while a new feature.aliases property could return the aliases.

Thanks,
Steve