code: public static void reportWarning(String message, String sourceName,
                                       int lineno, String lineSource,
                                       int lineOffset)
      {
          Context cx = Context.getContext();
          if (cx.hasFeature(FEATURE_WARNING_AS_ERROR))
              reportError(message, sourceName, lineno, lineSource, lineOffset);
          else
              cx.getErrorReporter().warning(message, sourceName, lineno,
                                            lineSource, lineOffset);
      }
docs: Report a warning using the error reporter for the current thread.
  
  @param message the warning message to report
  @param sourceName a string describing the source, such as a filename
  @param lineno the starting line number
  @param lineSource the text of the line (may be null)
  @param lineOffset the offset into lineSource where problem was detected
  @see org.mozilla.javascript.ErrorReporter