diff --git a/lib/ace/mode/javascript/jshint.js b/lib/ace/mode/javascript/jshint.js index 7dda3ee3..1faef4ce 100644 --- a/lib/ace/mode/javascript/jshint.js +++ b/lib/ace/mode/javascript/jshint.js @@ -2369,9 +2369,6 @@ var JSHINT = (function () { } function assume() { - if (state.option.es5) { - warning("I003"); - } if (state.option.couch) { combine(predefined, vars.couch); } @@ -2440,16 +2437,10 @@ var JSHINT = (function () { // Let's assume that chronologically ES3 < ES5 < ES6/ESNext < Moz state.option.inMoz = function (strict) { - if (strict) { - return state.option.moz && !state.option.esnext; - } return state.option.moz; }; state.option.inESNext = function (strict) { - if (strict) { - return !state.option.moz && state.option.esnext; - } return state.option.moz || state.option.esnext; }; @@ -2627,14 +2618,14 @@ var JSHINT = (function () { function doOption() { var nt = state.tokens.next; - var body = nt.body.split(",").map(function (s) { return s.trim(); }); + var body = nt.body.match(/(-\s+)?[^\s,]+(?:\s*:\s*(-\s+)?[^\s,]+)?/g); var predef = {}; if (nt.type === "globals") { body.forEach(function (g) { g = g.split(":"); - var key = g[0]; - var val = g[1]; + var key = (g[0] || "").trim(); + var val = (g[1] || "").trim(); if (key.charAt(0) === "-") { key = key.slice(1);