From 01685c255fda6e13f1cd2980130d2e388d52125c Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Sat, 4 Jul 2015 11:31:01 +0800 Subject: Updated codemirror to 5.4.0 --- public/vendor/codemirror/addon/lint/lint.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'public/vendor/codemirror/addon/lint') 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) { -- cgit v1.2.3