List metaData = watchedClass.getMetaData(BINDABLE, true);
boolean foundEvents = addBindables(watcher, metaData);
boolean foundSource = false;
Variable variable = getVariable(context, watchedClass, ref, multiName);
if (variable != null)
{
metaData = variable.getMetaData(BINDABLE);
foundEvents = addBindables(watcher, metaData) || foundEvents;
metaData = variable.getMetaData(CHANGE_EVENT);
foundEvents = addChangeEvents(watcher, metaData) || foundEvents;
metaData = variable.getMetaData(NON_COMMITTING_CHANGE_EVENT);
foundEvents = addNonCommittingChangeEvents(watcher, metaData) || foundEvents;
// Object has a public static const variable names "length", which is
// some legacy compatibility crap left over from EMCA script 262, so
// we ignore it.
if (variable.isConst() &&
!(multiName.getLocalPart().equals("length") &&
variable.getDeclaringClassName().equals(SymbolTable.OBJECT)))
{
// We didn't really find any events, but we want
// to follow the same code path below as if we did.
foundEvents = true;
// TODO will this ever be something besides a PropertyWatcher?
if (watcher instanceof PropertyWatcher)
{
((PropertyWatcher) watcher).suppress();
}
}
// See comment above.
if (!(multiName.getLocalPart().equals("length") &&
variable.getDeclaringClassName().equals(SymbolTable.OBJECT)))
{
checkForStaticProperty(variable.isStatic(), watcher, srcTypeName);
}
foundSource = true;
}