summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/addon/lint/lint.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/vendor/codemirror/addon/lint/lint.js')
-rwxr-xr-xpublic/vendor/codemirror/addon/lint/lint.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/public/vendor/codemirror/addon/lint/lint.js b/public/vendor/codemirror/addon/lint/lint.js
index c7e09396..3eea203c 100755
--- a/public/vendor/codemirror/addon/lint/lint.js
+++ b/public/vendor/codemirror/addon/lint/lint.js
@@ -63,11 +63,9 @@
this.onMouseOver = function(e) { onMouseOver(cm, e); };
}
- function parseOptions(cm, options) {
+ function parseOptions(_cm, options) {
if (options instanceof Function) return {getAnnotations: options};
if (!options || options === true) options = {};
- if (!options.getAnnotations) options.getAnnotations = cm.getHelper(CodeMirror.Pos(0, 0), "lint");
- if (!options.getAnnotations) throw new Error("Required option 'getAnnotations' missing (lint addon)");
return options;
}
@@ -120,10 +118,12 @@
function startLinting(cm) {
var state = cm.state.lint, options = state.options;
var passOptions = options.options || options; // Support deprecated passing of `options` property in options
- if (options.async || options.getAnnotations.async)
- options.getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
+ var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
+ if (!getAnnotations) return;
+ if (options.async || getAnnotations.async)
+ getAnnotations(cm.getValue(), updateLinting, passOptions, cm);
else
- updateLinting(cm, options.getAnnotations(cm.getValue(), passOptions, cm));
+ updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm));
}
function updateLinting(cm, annotationsNotSorted) {