Skip to content

Commit

Permalink
v2.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jugglinmike committed Aug 10, 2021
1 parent 11dc0a6 commit fddcd02
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 11 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,12 @@
<a name="2.13.1"></a>
## [2.13.1](https://github.com/jshint/jshint/compare/2.13.0...v2.13.1) (2021-08-10)

### Bug Fixes

* Allow invoking result of optional chaining ([71ec395](https://github.com/jshint/jshint/commit/71ec395))
* Allow optional chaining call as satement ([11dc0a6](https://github.com/jshint/jshint/commit/11dc0a6))
* Tolerate dangling NewExpression ([7c890aa](https://github.com/jshint/jshint/commit/7c890aa))

<a name="2.13.0"></a>
# [2.13.0](https://github.com/jshint/jshint/compare/2.12.0...v2.13.0) (2021-05-30)

Expand Down
29 changes: 24 additions & 5 deletions dist/jshint-rhino.js
@@ -1,6 +1,6 @@
#!/usr/bin/env rhino
var window = {};
/*! 2.13.0 */
/*! 2.13.1 */
var JSHINT;
if (typeof window === 'undefined') window = {};
(function () {
Expand Down Expand Up @@ -28031,11 +28031,16 @@ var JSHINT = (function() {

var opening = state.tokens.next;
var c = expression(context, 155), i;

if (!c) {
return this;
}

if (!c.paren && c.rbp > 160) {
error("E024", opening, opening.value);
}

if (c && c.id !== "function") {
if (c.id !== "function") {
if (c.identifier) {
switch (c.value) {
case "Number":
Expand Down Expand Up @@ -28384,6 +28389,7 @@ var JSHINT = (function() {
that.left = left;
advance();
that.right = state.tokens.curr.led(context, left);
that.exps = true;
} else {
state.syntax["."].led.call(that, context, left);
}
Expand All @@ -28395,6 +28401,21 @@ var JSHINT = (function() {
return that;
}, 160, true);


/**
* Determine if a CallExpression's "base" is a type of expression commonly
* used in this position.
*
* @param {token} token - token describing the "base" of the CallExpression
* @returns {boolean}
*/
function isTypicalCallExpression(token) {
return token.identifier || token.id === "." || token.id === "[" ||
token.id === "=>" || token.id === "(" || token.id === "&&" ||
token.id === "||" || token.id === "?" || token.id === "async" ||
token.id === "?." || (state.inES6() && token["(name)"]);
}

infix("(", function(context, left, that) {
if (state.option.immed && left && !left.immed && left.id === "function") {
warning("W062");
Expand Down Expand Up @@ -28485,9 +28506,7 @@ var JSHINT = (function() {
addEvalCode(left, p[0]);
}
}
if (!left.identifier && left.id !== "." && left.id !== "[" && left.id !== "=>" &&
left.id !== "(" && left.id !== "&&" && left.id !== "||" && left.id !== "?" &&
left.id !== "async" && !(state.inES6() && left["(name)"])) {
if (!isTypicalCallExpression(left)) {
warning("W067", that);
}
}
Expand Down
29 changes: 24 additions & 5 deletions dist/jshint.js
@@ -1,4 +1,4 @@
/*! 2.13.0 */
/*! 2.13.1 */
var JSHINT;
if (typeof window === 'undefined') window = {};
(function () {
Expand Down Expand Up @@ -28029,11 +28029,16 @@ var JSHINT = (function() {

var opening = state.tokens.next;
var c = expression(context, 155), i;

if (!c) {
return this;
}

if (!c.paren && c.rbp > 160) {
error("E024", opening, opening.value);
}

if (c && c.id !== "function") {
if (c.id !== "function") {
if (c.identifier) {
switch (c.value) {
case "Number":
Expand Down Expand Up @@ -28382,6 +28387,7 @@ var JSHINT = (function() {
that.left = left;
advance();
that.right = state.tokens.curr.led(context, left);
that.exps = true;
} else {
state.syntax["."].led.call(that, context, left);
}
Expand All @@ -28393,6 +28399,21 @@ var JSHINT = (function() {
return that;
}, 160, true);


/**
* Determine if a CallExpression's "base" is a type of expression commonly
* used in this position.
*
* @param {token} token - token describing the "base" of the CallExpression
* @returns {boolean}
*/
function isTypicalCallExpression(token) {
return token.identifier || token.id === "." || token.id === "[" ||
token.id === "=>" || token.id === "(" || token.id === "&&" ||
token.id === "||" || token.id === "?" || token.id === "async" ||
token.id === "?." || (state.inES6() && token["(name)"]);
}

infix("(", function(context, left, that) {
if (state.option.immed && left && !left.immed && left.id === "function") {
warning("W062");
Expand Down Expand Up @@ -28483,9 +28504,7 @@ var JSHINT = (function() {
addEvalCode(left, p[0]);
}
}
if (!left.identifier && left.id !== "." && left.id !== "[" && left.id !== "=>" &&
left.id !== "(" && left.id !== "&&" && left.id !== "||" && left.id !== "?" &&
left.id !== "async" && !(state.inES6() && left["(name)"])) {
if (!isTypicalCallExpression(left)) {
warning("W067", that);
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "jshint",
"version": "2.13.0",
"version": "2.13.1",
"homepage": "http://jshint.com/",
"description": "Static analysis tool for JavaScript",
"author": {
Expand Down

0 comments on commit fddcd02

Please sign in to comment.