MCPcopy Index your code
hub / github.com/socketstream/socketstream / registerLangHandler

Function registerLangHandler

docs/js/google-code-prettify.js:1239–1248  ·  view source on GitHub ↗

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 * {@

(handler, fileExtensions)

Source from the content-addressed store, hash-verified

1237 * @param {Array.<string>} fileExtensions
1238 */
1239 function registerLangHandler(handler, fileExtensions) {
1240 for (var i = fileExtensions.length; --i >= 0;) {
1241 var ext = fileExtensions[i];
1242 if (!langHandlerRegistry.hasOwnProperty(ext)) {
1243 langHandlerRegistry[ext] = handler;
1244 } else if (win['console']) {
1245 console['warn']('cannot override language handler %s', ext);
1246 }
1247 }
1248 }
1249 function langHandlerForExtension(extension, source) {
1250 if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
1251 // Treat it as markup if the first non whitespace character is a < and

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected