Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added line breaking error on 'return' statement with and without asi …

…option (when it's broken, fix it).
  • Loading branch information...
commit 9a50821f7dae23030ca7eb52d580d43acd7b89c0 1 parent f3d3a0f
@guyzmo authored
View
2  src/stable/jshint.js
@@ -3565,7 +3565,7 @@ var JSHINT = (function () {
warningAt("W093", this.first.line, this.first.character);
}
}
- } else if (!state.option.asi) {
+ } else {
nolinebreak(this); // always warn (Line breaking error)
}
reachable("return");
View
2  tests/stable/unit/options.js
@@ -338,6 +338,8 @@ exports.asi = function (test) {
TestRun(test, 2)
.addError(2, "Missing semicolon.") // throw on "use strict", even option asi is used
+ .addError(4, "Line breaking error 'return'.")
+ .addError(17, "Line breaking error 'return'.")
.test(src, { asi: true });
test.done();
View
1  tests/stable/unit/parser.js
@@ -2966,6 +2966,7 @@ exports["automatic comma insertion GH-950"] = function (test) {
var run = TestRun(test)
.addError(2, "Bad line breaking before 'instanceof'.")
.addError(6, "Bad line breaking before '&&'.")
+ .addError(8, "Line breaking error 'return'.")
.addError(9, "Label 'a' on 1 statement.")
.addError(9, "Expected an assignment or function call and instead saw an expression.");
Please sign in to comment.
Something went wrong with that request. Please try again.