src/com/google/javascript/jscomp/TypeCheck.java
/**
   * @param strictCheck Whether this is a check that is only performed when "strict missing
   *     properties" checks are enabled.
   */
@param strictCheck Whether this is a check that is only performed when "strict missing
properties" checks are enabled.
@param strictCheck Whether this is a check that is only performed when " strict missing properties " checks are enabled .
private void checkPropertyAccessHelper(
      JSType objectType,
      Node propNode,
      @Nullable Node objNode,
      NodeTraversal t,
      Node getProp,
      boolean strictCheck) {
    if (!reportMissingProperties
        || objectType.isEmptyType()
        || (getProp != null && allowStrictPropertyAccessOnNode(getProp))) {
      return;
    }
    String propName = propNode.getString();
    PropDefinitionKind kind = typeRegistry.canPropertyBeDefined(objectType, propName);
    if (kind.equals(PropDefinitionKind.KNOWN)) {
      return;
    }
    boolean isLooselyAssociated = kind.equals(PropDefinitionKind.LOOSE)
        || kind.equals(PropDefinitionKind.LOOSE_UNION);
    boolean isUnknownType = objectType.isUnknownType();
    if (isLooselyAssociated && isUnknownType) {
      return;
    }
    boolean isStruct = objectType.isStruct();
    boolean loosePropertyDeclaration =
        getProp != null && isQNameAssignmentTarget(getProp) && !isStruct;
    boolean maybePropExistenceCheck =
        !isStruct && getProp != null && allowLoosePropertyAccessOnNode(getProp);
    boolean strictReport =
        strictCheck || isLooselyAssociated || loosePropertyDeclaration || maybePropExistenceCheck;
    reportMissingProperty(objNode, objectType, propNode, kind, t, strictReport);
  }
private void checkPropertyAccessHelper ( JSType objectType , Node propNode , @ Nullable Node objNode , NodeTraversal t , Node getProp , boolean strictCheck ) { if ( ! reportMissingProperties || objectType . isEmptyType ( ) || ( getProp != null && allowStrictPropertyAccessOnNode ( getProp ) ) ) { return ; } String propName = propNode . getString ( ) ; PropDefinitionKind kind = typeRegistry . canPropertyBeDefined ( objectType , propName ) ; if ( kind . equals ( PropDefinitionKind . KNOWN ) ) { return ; } boolean isLooselyAssociated = kind . equals ( PropDefinitionKind . LOOSE ) || kind . equals ( PropDefinitionKind . LOOSE_UNION ) ; boolean isUnknownType = objectType . isUnknownType ( ) ; if ( isLooselyAssociated && isUnknownType ) { return ; } boolean isStruct = objectType . isStruct ( ) ; boolean loosePropertyDeclaration = getProp != null && isQNameAssignmentTarget ( getProp ) && ! isStruct ; boolean maybePropExistenceCheck = ! isStruct && getProp != null && allowLoosePropertyAccessOnNode ( getProp ) ; boolean strictReport = strictCheck || isLooselyAssociated || loosePropertyDeclaration || maybePropExistenceCheck ; reportMissingProperty ( objNode , objectType , propNode , kind , t , strictReport ) ; }
@param strictCheck Whether this is a check that is only performed when "strict missing
     properties" checks are enabled.
@param strictCheck Whether this is a check that is only performed when " strict missing properties " checks are enabled .
// If the property definition is known, but only loosely associated, // only report a "strict error" which can be optional as code is migrated. // We still don't want to report this. // always false for destructuring // Traditionally, we would not report a warning for "loose" properties, but we want to be // able to be more strict, so introduce an optional warning.