function registerLangHandler(handler, fileExtensions) {
    for (var i = fileExtensions.length; --i >= 0;) {
      var ext = fileExtensions[i];
      if (!langHandlerRegistry.hasOwnProperty(ext)) {
        langHandlerRegistry[ext] = handler;
      } else if ('console' in window) {
        console['warn']('cannot override language handler %s', ext);
      }
    }
  }
Register a language handler for the given file extensions.
@param {function (Object)} handler a function from source code to a list
     of decorations.  Takes a single argument job which describes the
     state of the computation.   The single parameter has the form
     {@code {
       source: {string} as plain text.
       decorations: {Array.<number|string>} an array of style classes
                    preceded by the position at which they start in
                    job.source in order.
                    The language handler should assigned this field.
       basePos: {int} the position of source in the larger source chunk.
                All positions in the output decorations array are relative
                to the larger source chunk.
     } }
@param {Array.<string>} fileExtensions