code: private void checkConstantProperty(
        @Nullable PropertyReference propRef, IdentifierBehaviour identifierBehaviour) {
      if (propRef == null || identifierBehaviour.equals(IdentifierBehaviour.ES5_CLASS_NAMESPACE)) {
        return;
      }
  
      if (!propRef.isMutation()) {
        return;
      }
  
      ObjectType objectType = castToObject(dereference(propRef.getReceiverType()));
  
      String propertyName = propRef.getName();
  
      boolean isConstant = isPropertyDeclaredConstant(objectType, propertyName);
  
      // Check whether constant properties are reassigned
      if (isConstant) {
        if (propRef.isDeletion()) {
          compiler.report(
              JSError.make(propRef.getSourceNode(), CONST_PROPERTY_DELETED, propertyName));
          return;
        }
  
        // Can't check for constant properties on generic function types.
        // TODO(johnlenz): I'm not 100% certain this is necessary, or if
        // the type is being inspected incorrectly.
        if (objectType == null
            || (objectType.isFunctionType()
                && !objectType.toMaybeFunctionType().isConstructor())) {
          return;
        }
  
        ObjectType oType = objectType;
        while (oType != null) {
          if (initializedConstantProperties.containsEntry(oType, propertyName)
              || initializedConstantProperties.containsEntry(
                  getCanonicalInstance(oType), propertyName)) {
            compiler.report(
                JSError.make(propRef.getSourceNode(), CONST_PROPERTY_REASSIGNED_VALUE, propertyName));
            break;
          }
          oType = oType.getImplicitPrototype();
        }
  
        initializedConstantProperties.put(objectType, propertyName);
  
        // Add the prototype when we're looking at an instance object
        if (objectType.isInstanceType()) {
          ObjectType prototype = objectType.getImplicitPrototype();
          if (prototype != null && prototype.hasProperty(propertyName)) {
            initializedConstantProperties.put(prototype, propertyName);
          }
        }
      }
    }
docs: Determines whether the given constant property got reassigned