Skip to content

Commit f4febe8

Browse files
author
Anton Kovalyov
committed
2.5.1
1 parent d8a858c commit f4febe8

3 files changed

Lines changed: 173 additions & 39 deletions

File tree

dist/jshint-rhino.js

Lines changed: 86 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env rhino
22
var window = {};
3-
// 2.5.0
3+
/*! 2.5.1 */
44
var JSHINT;
55
if (typeof window === 'undefined') window = {};
66
(function () {
@@ -52846,6 +52846,7 @@ var JSHINT = (function () {
5284652846
globalstrict: true, // if global "use strict"; should be allowed (also enables 'strict')
5284752847
immed : true, // if immediate invocations must be wrapped in parens
5284852848
iterator : true, // if the `__iterator__` property should be allowed
52849+
jasmine : true, // Jasmine functions should be predefined
5284952850
jquery : true, // if jQuery globals should be predefined
5285052851
lastsemic : true, // if semicolons may be ommitted for the trailing
5285152852
// statements inside of a one-line blocks.
@@ -52871,6 +52872,7 @@ var JSHINT = (function () {
5287152872
proto : true, // if the `__proto__` property should be allowed
5287252873
prototypejs : true, // if Prototype and Scriptaculous globals should be
5287352874
// predefined
52875+
qunit : true, // if the QUnit environment globals should be predefined
5287452876
rhino : true, // if the Rhino environment globals should be predefined
5287552877
shelljs : true, // if ShellJS globals should be predefined
5287652878
typed : true, // if typed array globals should be predefined
@@ -53081,6 +53083,10 @@ var JSHINT = (function () {
5308153083
combine(predefined, vars.couch);
5308253084
}
5308353085

53086+
if (state.option.qunit) {
53087+
combine(predefined, vars.qunit);
53088+
}
53089+
5308453090
if (state.option.rhino) {
5308553091
combine(predefined, vars.rhino);
5308653092
}
@@ -53123,6 +53129,10 @@ var JSHINT = (function () {
5312353129
combine(predefined, vars.nonstandard);
5312453130
}
5312553131

53132+
if (state.option.jasmine) {
53133+
combine(predefined, vars.jasmine);
53134+
}
53135+
5312653136
if (state.option.jquery) {
5312753137
combine(predefined, vars.jquery);
5312853138
}
@@ -54297,6 +54307,21 @@ var JSHINT = (function () {
5429754307
}
5429854308
}
5429954309

54310+
function parseFinalSemicolon() {
54311+
if (state.tokens.next.id !== ";") {
54312+
if (!state.option.asi) {
54313+
// If this is the last statement in a block that ends on
54314+
// the same line *and* option lastsemic is on, ignore the warning.
54315+
// Otherwise, complain about missing semicolon.
54316+
if (!state.option.lastsemic || state.tokens.next.id !== "}" ||
54317+
state.tokens.next.line !== state.tokens.curr.line) {
54318+
warningAt("W033", state.tokens.curr.line, state.tokens.curr.character);
54319+
}
54320+
}
54321+
} else {
54322+
advance(";");
54323+
}
54324+
}
5430054325

5430154326
function statement() {
5430254327
var values;
@@ -54319,6 +54344,23 @@ var JSHINT = (function () {
5431954344
res = false;
5432054345
}
5432154346

54347+
// detect a module import declaration
54348+
if (t.value === "module" && t.type === "(identifier)") {
54349+
if (peek().type === "(identifier)") {
54350+
if (!state.option.inESNext()) {
54351+
warning("W119", state.tokens.curr, "module");
54352+
}
54353+
54354+
advance("module");
54355+
var name = identifier();
54356+
addlabel(name, { type: "unused", token: state.tokens.curr });
54357+
advance("from");
54358+
advance("(string)");
54359+
parseFinalSemicolon();
54360+
return;
54361+
}
54362+
}
54363+
5432254364
// detect a destructuring assignment
5432354365
if (_.has(["[", "{"], t.value)) {
5432454366
if (lookupBlockType().isDestAssign) {
@@ -54384,22 +54426,10 @@ var JSHINT = (function () {
5438454426
} else if (state.option.nonew && r && r.left && r.id === "(" && r.left.id === "new") {
5438554427
warning("W031", t);
5438654428
}
54387-
54388-
if (state.tokens.next.id !== ";") {
54389-
if (!state.option.asi) {
54390-
// If this is the last statement in a block that ends on
54391-
// the same line *and* option lastsemic is on, ignore the warning.
54392-
// Otherwise, complain about missing semicolon.
54393-
if (!state.option.lastsemic || state.tokens.next.id !== "}" ||
54394-
state.tokens.next.line !== state.tokens.curr.line) {
54395-
warningAt("W033", state.tokens.curr.line, state.tokens.curr.character);
54396-
}
54397-
}
54398-
} else {
54399-
advance(";");
54400-
}
54429+
parseFinalSemicolon();
5440154430
}
5440254431

54432+
5440354433
// Restore the indentation.
5440454434

5440554435
indent = i;
@@ -56937,7 +56967,6 @@ var JSHINT = (function () {
5693756967
FutureReservedWord("static", { es5: true, strictOnly: true });
5693856968
FutureReservedWord("super", { es5: true });
5693956969
FutureReservedWord("synchronized");
56940-
FutureReservedWord("throws");
5694156970
FutureReservedWord("transient");
5694256971
FutureReservedWord("volatile");
5694356972

@@ -59648,7 +59677,7 @@ exports.starSlash = /\*\//;
5964859677
exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/;
5964959678

5965059679
// JavaScript URL (jx)
59651-
exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i;
59680+
exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|livescript)\s*:/i;
5965259681

5965359682
// Catches /* falls through */ comments (ft)
5965459683
exports.fallsThrough = /^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/;
@@ -59817,7 +59846,7 @@ exports.register = function (linter) {
5981759846
// Warn about script URLs.
5981859847

5981959848
linter.on("String", function style_scanJavaScriptURLs(data) {
59820-
var re = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i;
59849+
var re = /^(?:javascript|jscript|ecmascript|vbscript|livescript)\s*:/i;
5982159850

5982259851
if (linter.getOption("scripturl")) {
5982359852
return;
@@ -60248,6 +60277,27 @@ exports.phantom = {
6024860277
exports : true // v1.7+
6024960278
};
6025060279

60280+
exports.qunit = {
60281+
asyncTest : false,
60282+
deepEqual : false,
60283+
equal : false,
60284+
expect : false,
60285+
module : false,
60286+
notDeepEqual : false,
60287+
notEqual : false,
60288+
notPropEqual : false,
60289+
notStrictEqual : false,
60290+
ok : false,
60291+
propEqual : false,
60292+
QUnit : false,
60293+
raises : false,
60294+
start : false,
60295+
stop : false,
60296+
strictEqual : false,
60297+
test : false,
60298+
"throws" : false
60299+
};
60300+
6025160301
exports.rhino = {
6025260302
defineClass : false,
6025360303
deserialize : false,
@@ -60367,7 +60417,7 @@ exports.mootools = {
6036760417
Group : false,
6036860418
Hash : false,
6036960419
HtmlTable : false,
60370-
Iframe : false,
60420+
IFrame : false,
6037160421
IframeShim : false,
6037260422
InputValidator: false,
6037360423
instanceOf : false,
@@ -60454,6 +60504,23 @@ exports.mocha = {
6045460504
teardown : false
6045560505
};
6045660506

60507+
exports.jasmine = {
60508+
jasmine : false,
60509+
describe : false,
60510+
it : false,
60511+
xit : false,
60512+
beforeEach : false,
60513+
afterEach : false,
60514+
setFixtures : false,
60515+
loadFixtures: false,
60516+
spyOn : false,
60517+
expect : false,
60518+
// Jasmine 1.3
60519+
runs : false,
60520+
waitsFor : false,
60521+
waits : false
60522+
};
60523+
6045760524
},{}]},{},["fNbQ4d"])
6045860525
JSHINT = require('jshint').JSHINT;
6045960526
if (typeof exports === 'object' && exports) exports.JSHINT = JSHINT;

0 commit comments

Comments
 (0)