}
// Find an object literal's value for a given key. If not found,
// return null.
protected Node findLiteralValue(Node objLiteral, String key) {
Node literalValueNode = null;
// Get list of all properties
Object[] propertyList = (Object[]) objLiteral.getProp(Token.EQ);
// Iterate through key/values looking for a match
if (propertyList != null) {
Node propertyValue = objLiteral.getFirstChild();
for(int index = 0; index < propertyList.length; index++) {
if (key.equals(propertyList[index])) {
literalValueNode = propertyValue;
break;
}
propertyValue = propertyValue.getNext();
}
}
return literalValueNode;
}