Permalink
Browse files

Issue #1433: Remove overzealous W092

Signed-off-by: Anton Kovalyov <anton@kovalyov.net>
  • Loading branch information...
1 parent cafee76 commit 9b8b363b04112c6cb38ad200124826d1ff0fc37d @benesch benesch committed with valueof Jan 3, 2014
Showing with 0 additions and 13 deletions.
  1. +0 −6 src/jshint.js
  2. +0 −1 src/messages.js
  3. +0 −6 tests/regression/thirdparty.js
View
6 src/jshint.js
@@ -4121,9 +4121,6 @@ var JSHINT = (function () {
stmt("return", function () {
if (this.line === state.tokens.next.line) {
- if (state.tokens.next.id === "(regexp)")
- warning("W092");
-
if (state.tokens.next.id !== ";" && !state.tokens.next.reach) {
nonadjacent(state.tokens.curr, state.tokens.next);
this.first = expression(0);
@@ -4156,9 +4153,6 @@ var JSHINT = (function () {
}
funct["(generator)"] = "yielded";
if (this.line === state.tokens.next.line || !state.option.inMoz(true)) {
- if (state.tokens.next.id === "(regexp)")
- warning("W092");
-
if (state.tokens.next.id !== ";" && !state.tokens.next.reach && state.tokens.next.nud) {
nobreaknonadjacent(state.tokens.curr, state.tokens.next);
this.first = expression(10);
View
1 src/messages.js
@@ -165,7 +165,6 @@ var warnings = {
"unwanted properties from the prototype.",
W090: "'{a}' is not a statement label.",
W091: "'{a}' is out of scope.",
- W092: "Wrap the /regexp/ literal in parens to disambiguate the slash operator.",
W093: "Did you mean to return a conditional instead of an assignment?",
W094: "Unexpected comma.",
W095: "Expected a string and instead saw {a}.",
View
6 tests/regression/thirdparty.js
@@ -75,7 +75,6 @@ exports.prototype_1_7 = function (test) {
.addError(451, "Missing semicolon.")
.addError(633, "Use '!==' to compare with 'undefined'.")
.addError(737, "Use '===' to compare with ''.")
- .addError(741, "Wrap the /regexp/ literal in parens to disambiguate the slash operator.")
.addError(807, "Use '===' to compare with ''.")
.addError(1137, "Use '===' to compare with '0'.")
.addError(1215, "Missing semicolon.")
@@ -103,8 +102,6 @@ exports.prototype_1_7 = function (test) {
.addError(4312, "'nodeCheck' used out of scope.")
.addError(4318, "You might be leaking a variable (part) here.")
.addError(4322, "'nodeCheck' used out of scope.")
- .addError(4450, "Wrap the /regexp/ literal in parens to disambiguate the slash operator.")
- .addError(4480, "Wrap the /regexp/ literal in parens to disambiguate the slash operator.")
.addError(4520, "'i' is already defined.")
.addError(4538, "Expected a 'break' statement before 'case'.")
.addError(4547, "Use '===' to compare with '0'.")
@@ -117,7 +114,6 @@ exports.prototype_1_7 = function (test) {
.addError(4988, "Missing semicolon.")
.addError(5021, "Missing semicolon.")
.addError(5397, "Missing semicolon.")
- .addError(5061, "Wrap the /regexp/ literal in parens to disambiguate the slash operator.")
.addError(5112, "Use '!==' to compare with 'undefined'.")
.addError(5140, "Use '!==' to compare with ''.")
.addError(5224, "'values' is already defined.")
@@ -226,12 +222,10 @@ exports.codemirror3 = function (test) {
.addError(1532, "'mY' is defined but never used.")
.addError(1533, "Value of 'e' may be overwritten in IE 8 and earlier.")
.addError(2218, "'state' is defined but never used.")
- .addError(2298, "Wrap the /regexp/ literal in parens to disambiguate the slash operator.")
.addError(2427, "'style' is defined but never used.")
.addError(2696, "'target' is defined but never used.")
.addError(3168, "'ok' is defined but never used.")
.addError(4093, "Unnecessary semicolon.")
- .addError(4168, "Wrap the /regexp/ literal in parens to disambiguate the slash operator.")
.addError(4277, "'range' is defined but never used.")
.test(src, opt, { CodeMirror: true });

0 comments on commit 9b8b363

Please sign in to comment.