warn function

void warn (String message, { bool deprecation: false })

Prints a warning message associated with the current @import or function call.

If deprecation is true, the warning is emitted as a deprecation warning.

This may only be called within a custom function or importer callback.

Implementation

void warn(String message, {bool deprecation = false}) {
  var warnDefinition = Zone.current[#_warn];

  if (warnDefinition == null) {
    throw ArgumentError(
        "warn() may only be called within a custom function or importer "
        "callback.");
  }

  warnDefinition(message, deprecation);
}