Fix compile errors caused by Function<> types

Apparently templating upper case Function is not supported:
When turning on compilation_mode="SIMPLE", they cause errors like:

[internal]:27809 ERROR - Too many template parameters

I checked the docs:
https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System

Under "Instance Type":
"Also avoid using Function in favor of the more specific
 function(...): ..."

Change-Id: I1cffbee0a7922be0fb7b40d3db6144aece46e0da
This commit is contained in:
Ole Rehmsen
2018-09-18 17:26:16 +02:00
parent d3a779a8b4
commit b57db23f7b

View File

@@ -34,7 +34,7 @@
* Register a function to call to apply annotations. Plugins should use * Register a function to call to apply annotations. Plugins should use
* GrAnnotationActionsContext.annotateRange to apply a CSS class to a range * GrAnnotationActionsContext.annotateRange to apply a CSS class to a range
* within a line. * within a line.
* @param {Function<GrAnnotationActionsContext>} addLayerFunc The function * @param {function(GrAnnotationActionsContext)} addLayerFunc The function
* that will be called when the AnnotationLayer is ready to annotate. * that will be called when the AnnotationLayer is ready to annotate.
*/ */
GrAnnotationActionsInterface.prototype.addLayer = function(addLayerFunc) { GrAnnotationActionsInterface.prototype.addLayer = function(addLayerFunc) {
@@ -45,7 +45,7 @@
/** /**
* The specified function will be called with a notify function for the plugin * The specified function will be called with a notify function for the plugin
* to call when it has all required data for annotation. Optional. * to call when it has all required data for annotation. Optional.
* @param {Function<Function<String, Number, Number, String>>} notifyFunc See * @param {function(function(String, Number, Number, String))} notifyFunc See
* doc of the notify function below to see what it does. * doc of the notify function below to see what it does.
*/ */
GrAnnotationActionsInterface.prototype.addNotifier = function(notifyFunc) { GrAnnotationActionsInterface.prototype.addNotifier = function(notifyFunc) {
@@ -68,7 +68,7 @@
* *
* @param {String} checkboxLabel Will be used as the label for the checkbox. * @param {String} checkboxLabel Will be used as the label for the checkbox.
* Optional. "Enable" is used if this is not specified. * Optional. "Enable" is used if this is not specified.
* @param {Function<HTMLElement>} onAttached The function that will be called * @param {function(HTMLElement)} onAttached The function that will be called
* when the checkbox is attached to the page. * when the checkbox is attached to the page.
*/ */
GrAnnotationActionsInterface.prototype.enableToggleCheckbox = function( GrAnnotationActionsInterface.prototype.enableToggleCheckbox = function(
@@ -134,7 +134,7 @@
* @param {String} path The file path (eg: /COMMIT_MSG'). * @param {String} path The file path (eg: /COMMIT_MSG').
* @param {String} changeNum The Gerrit change number. * @param {String} changeNum The Gerrit change number.
* @param {String} patchNum The Gerrit patch number. * @param {String} patchNum The Gerrit patch number.
* @param {Function<GrAnnotationActionsContext>} addLayerFunc The function * @param {function(GrAnnotationActionsContext)} addLayerFunc The function
* that will be called when the AnnotationLayer is ready to annotate. * that will be called when the AnnotationLayer is ready to annotate.
*/ */
function AnnotationLayer(path, changeNum, patchNum, addLayerFunc) { function AnnotationLayer(path, changeNum, patchNum, addLayerFunc) {
@@ -148,7 +148,7 @@
/** /**
* Register a listener for layer updates. * Register a listener for layer updates.
* @param {Function<Number, Number, String>} fn The update handler function. * @param {function(Number, Number, String)} fn The update handler function.
* Should accept as arguments the line numbers for the start and end of * Should accept as arguments the line numbers for the start and end of
* the update and the side as a string. * the update and the side as a string.
*/ */