code: private boolean ensurePropertyDeclaredHelper(
        Node getprop, ObjectType objectType, FlowScope scope) {
      if (getprop.isQualifiedName()) {
        String propName = getprop.getLastChild().getString();
        String qName = getprop.getQualifiedName();
        TypedVar var = getDeclaredVar(scope, qName);
        if (var != null && !var.isTypeInferred()) {
          // Handle normal declarations that could not be addressed earlier.
          if (propName.equals("prototype")
              ||
              // Handle prototype declarations that could not be addressed earlier.
              (!objectType.hasOwnProperty(propName)
                  && (!objectType.isInstanceType()
                      || (var.isExtern() && !objectType.isNativeObjectType())))) {
            return objectType.defineDeclaredProperty(
                propName, var.getType(), getprop);
          }
        }
      }
      return false;
    }
docs: Declares a property on its owner, if necessary.
  
  @return True if a property was declared.