From 5608b0351972daf173c7ec480ba7d1e1b6a3f3e3 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Mon, 27 Dec 2021 16:34:02 -0500 Subject: [PATCH] v2.13.2 --- CHANGELOG.md | 12 ++++++++++ dist/jshint-rhino.js | 55 ++++++++++++++++++++++++++------------------ dist/jshint.js | 55 ++++++++++++++++++++++++++------------------ package.json | 2 +- 4 files changed, 79 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d430168c0..79f504e30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ + +## [2.13.2](https://github.com/jshint/jshint/compare/2.13.1...v2.13.2) (2021-12-27) + +### Bug Fixes + +* Add missing well-known globals (#3582) ([cc1adf6](https://github.com/jshint/jshint/commit/cc1adf6)) +* add URL for node in src/vars.js (#3570) ([ca06e6a](https://github.com/jshint/jshint/commit/ca06e6a)) +* change escape-sequence handler for double quotes (\") (#3566) ([75e48b7](https://github.com/jshint/jshint/commit/75e48b7)) +* Limit "Too many Errors" (E043) to errors only (#3562) ([4a681b9](https://github.com/jshint/jshint/commit/4a681b9)) +* Tolerate keyword in object shorthand ([057b1c6](https://github.com/jshint/jshint/commit/057b1c6)) +* Tolerate unterminated nullish coalescing ([ecae54a](https://github.com/jshint/jshint/commit/ecae54a)) + ## [2.13.1](https://github.com/jshint/jshint/compare/2.13.0...v2.13.1) (2021-08-10) diff --git a/dist/jshint-rhino.js b/dist/jshint-rhino.js index b3cf997d7..538aafbf2 100755 --- a/dist/jshint-rhino.js +++ b/dist/jshint-rhino.js @@ -1,6 +1,6 @@ #!/usr/bin/env rhino var window = {}; -/*! 2.13.1 */ +/*! 2.13.2 */ var JSHINT; if (typeof window === 'undefined') window = {}; (function () { @@ -19774,9 +19774,6 @@ Lexer.prototype = { case "\\": char = "\\\\"; break; - case "\"": - char = "\\\""; - break; case "/": break; case "": @@ -22158,7 +22155,7 @@ exports.val = { indent : false, /** - * This options allows you to set the maximum amount of warnings JSHint will + * This options allows you to set the maximum amount of errors JSHint will * produce before giving up. Default is 50. */ maxerr : false, @@ -24573,6 +24570,9 @@ exports.ecmaIdentifiers = { 8: { Atomics : false, SharedArrayBuffer : false + }, + 11: { + BigInt : false } }; @@ -24926,6 +24926,7 @@ exports.browser = { TimeEvent : false, top : false, URL : false, + URLSearchParams : false, WebGLActiveInfo : false, WebGLBuffer : false, WebGLContextEvent : false, @@ -25012,20 +25013,23 @@ exports.node = { global : false, module : false, require : false, + Intl : false, // These globals are writeable because Node allows the following // usage pattern: var Buffer = require("buffer").Buffer; - Buffer : true, - console : true, - exports : true, - process : true, - setTimeout : true, - clearTimeout : true, - setInterval : true, - clearInterval : true, - setImmediate : true, // v0.9.1+ - clearImmediate: true // v0.9.1+ + Buffer : true, + console : true, + exports : true, + process : true, + setTimeout : true, + clearTimeout : true, + setInterval : true, + clearInterval : true, + setImmediate : true, // v0.9.1+ + clearImmediate : true, // v0.9.1+ + URL : true, // v6.13.0+ + URLSearchParams: true // v6.13.0+ }; exports.browserify = { @@ -25267,10 +25271,12 @@ exports.mocha = { // BDD describe : false, xdescribe : false, - it : false, - xit : false, context : false, xcontext : false, + it : false, + xit : false, + specify : false, + xspecify : false, before : false, after : false, beforeEach : false, @@ -25737,9 +25743,10 @@ var JSHINT = (function() { removeIgnoredMessages(); - if (JSHINT.errors.length >= state.option.maxerr) + var errors = JSHINT.errors.filter(function(e) { return /E\d{3}/.test(e.code); }); + if (errors.length >= state.option.maxerr) { quit("E043", t); - + } return w; } @@ -27764,7 +27771,9 @@ var JSHINT = (function() { that.left = left; var right = that.right = expression(context, 39); - if (!right.paren && (right.id === "||" || right.id === "&&")) { + if (!right) { + error("E024", state.tokens.next, state.tokens.next.id); + } else if (!right.paren && (right.id === "||" || right.id === "&&")) { error("E024", that.right, that.right.id); } @@ -29386,8 +29395,10 @@ var JSHINT = (function() { warning("W104", state.tokens.next, "object short notation", "6"); } t = expression(context, 10); - i = t.value; - saveProperty(props, i, t); + i = t && t.value; + if (t) { + saveProperty(props, i, t); + } } else if (peek().id !== ":" && (nextVal === "get" || nextVal === "set")) { advance(nextVal); diff --git a/dist/jshint.js b/dist/jshint.js index 853724450..cf8153027 100644 --- a/dist/jshint.js +++ b/dist/jshint.js @@ -1,4 +1,4 @@ -/*! 2.13.1 */ +/*! 2.13.2 */ var JSHINT; if (typeof window === 'undefined') window = {}; (function () { @@ -19772,9 +19772,6 @@ Lexer.prototype = { case "\\": char = "\\\\"; break; - case "\"": - char = "\\\""; - break; case "/": break; case "": @@ -22156,7 +22153,7 @@ exports.val = { indent : false, /** - * This options allows you to set the maximum amount of warnings JSHint will + * This options allows you to set the maximum amount of errors JSHint will * produce before giving up. Default is 50. */ maxerr : false, @@ -24571,6 +24568,9 @@ exports.ecmaIdentifiers = { 8: { Atomics : false, SharedArrayBuffer : false + }, + 11: { + BigInt : false } }; @@ -24924,6 +24924,7 @@ exports.browser = { TimeEvent : false, top : false, URL : false, + URLSearchParams : false, WebGLActiveInfo : false, WebGLBuffer : false, WebGLContextEvent : false, @@ -25010,20 +25011,23 @@ exports.node = { global : false, module : false, require : false, + Intl : false, // These globals are writeable because Node allows the following // usage pattern: var Buffer = require("buffer").Buffer; - Buffer : true, - console : true, - exports : true, - process : true, - setTimeout : true, - clearTimeout : true, - setInterval : true, - clearInterval : true, - setImmediate : true, // v0.9.1+ - clearImmediate: true // v0.9.1+ + Buffer : true, + console : true, + exports : true, + process : true, + setTimeout : true, + clearTimeout : true, + setInterval : true, + clearInterval : true, + setImmediate : true, // v0.9.1+ + clearImmediate : true, // v0.9.1+ + URL : true, // v6.13.0+ + URLSearchParams: true // v6.13.0+ }; exports.browserify = { @@ -25265,10 +25269,12 @@ exports.mocha = { // BDD describe : false, xdescribe : false, - it : false, - xit : false, context : false, xcontext : false, + it : false, + xit : false, + specify : false, + xspecify : false, before : false, after : false, beforeEach : false, @@ -25735,9 +25741,10 @@ var JSHINT = (function() { removeIgnoredMessages(); - if (JSHINT.errors.length >= state.option.maxerr) + var errors = JSHINT.errors.filter(function(e) { return /E\d{3}/.test(e.code); }); + if (errors.length >= state.option.maxerr) { quit("E043", t); - + } return w; } @@ -27762,7 +27769,9 @@ var JSHINT = (function() { that.left = left; var right = that.right = expression(context, 39); - if (!right.paren && (right.id === "||" || right.id === "&&")) { + if (!right) { + error("E024", state.tokens.next, state.tokens.next.id); + } else if (!right.paren && (right.id === "||" || right.id === "&&")) { error("E024", that.right, that.right.id); } @@ -29384,8 +29393,10 @@ var JSHINT = (function() { warning("W104", state.tokens.next, "object short notation", "6"); } t = expression(context, 10); - i = t.value; - saveProperty(props, i, t); + i = t && t.value; + if (t) { + saveProperty(props, i, t); + } } else if (peek().id !== ":" && (nextVal === "get" || nextVal === "set")) { advance(nextVal); diff --git a/package.json b/package.json index fd154ce86..219681d86 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jshint", - "version": "2.13.1", + "version": "2.13.2", "homepage": "http://jshint.com/", "description": "Static analysis tool for JavaScript", "author": {