Skip to content

Commit

Permalink
v2.13.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jugglinmike committed Jan 24, 2022
1 parent eb4609a commit 61c868c
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 23 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
<a name="2.13.4"></a>
## [2.13.4](https://github.com/jshint/jshint/compare/2.13.3...v2.13.4) (2022-01-24)

### Bug Fixes

* Remove shelljs ([eb4609a](https://github.com/jshint/jshint/commit/eb4609a))

<a name="2.13.3"></a>
## [2.13.3](https://github.com/jshint/jshint/compare/2.13.2...v2.13.3) (2022-01-05)

Expand Down
68 changes: 58 additions & 10 deletions dist/jshint-rhino.js
@@ -1,6 +1,6 @@
#!/usr/bin/env rhino
var window = {};
/*! 2.13.3 */
/*! 2.13.4 */
var JSHINT;
if (typeof window === 'undefined') window = {};
(function () {
Expand Down Expand Up @@ -1442,14 +1442,15 @@ function isUndefined(arg) {
var undefined;

/** Used as the semantic version number. */
var VERSION = '4.17.20';
var VERSION = '4.17.21';

/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;

/** Error message constants. */
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
FUNC_ERROR_TEXT = 'Expected a function';
FUNC_ERROR_TEXT = 'Expected a function',
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';

/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
Expand Down Expand Up @@ -1582,10 +1583,11 @@ function isUndefined(arg) {
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);

/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g,
reTrimStart = /^\s+/,
reTrimEnd = /\s+$/;
/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;

/** Used to match a single whitespace character. */
var reWhitespace = /\s/;

/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
Expand All @@ -1595,6 +1597,18 @@ function isUndefined(arg) {
/** Used to match words composed of alphanumeric characters. */
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;

/**
* Used to validate the `validate` option in `_.template` variable.
*
* Forbids characters which could potentially change the meaning of the function argument definition:
* - "()," (modification of function parameters)
* - "=" (default value)
* - "[]{}" (destructuring of function parameters)
* - "/" (beginning of a comment)
* - whitespace
*/
var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;

/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;

Expand Down Expand Up @@ -2423,6 +2437,19 @@ function isUndefined(arg) {
});
}

/**
* The base implementation of `_.trim`.
*
* @private
* @param {string} string The string to trim.
* @returns {string} Returns the trimmed string.
*/
function baseTrim(string) {
return string
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
: string;
}

/**
* The base implementation of `_.unary` without support for storing metadata.
*
Expand Down Expand Up @@ -2756,6 +2783,21 @@ function isUndefined(arg) {
: asciiToArray(string);
}

/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
* character of `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the index of the last non-whitespace character.
*/
function trimmedEndIndex(string) {
var index = string.length;

while (index-- && reWhitespace.test(string.charAt(index))) {}
return index;
}

/**
* Used by `_.unescape` to convert HTML entities to characters.
*
Expand Down Expand Up @@ -13924,7 +13966,7 @@ function isUndefined(arg) {
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
Expand Down Expand Up @@ -16296,6 +16338,12 @@ function isUndefined(arg) {
if (!variable) {
source = 'with (obj) {\n' + source + '\n}\n';
}
// Throw an error if a forbidden character was found in `variable`, to prevent
// potential command injection attacks.
else if (reForbiddenIdentifierChars.test(variable)) {
throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
}

// Cleanup code by stripping empty strings.
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
.replace(reEmptyStringMiddle, '$1')
Expand Down Expand Up @@ -16409,7 +16457,7 @@ function isUndefined(arg) {
function trim(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrim, '');
return baseTrim(string);
}
if (!string || !(chars = baseToString(chars))) {
return string;
Expand Down Expand Up @@ -16444,7 +16492,7 @@ function isUndefined(arg) {
function trimEnd(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrimEnd, '');
return string.slice(0, trimmedEndIndex(string) + 1);
}
if (!string || !(chars = baseToString(chars))) {
return string;
Expand Down
68 changes: 58 additions & 10 deletions dist/jshint.js
@@ -1,4 +1,4 @@
/*! 2.13.3 */
/*! 2.13.4 */
var JSHINT;
if (typeof window === 'undefined') window = {};
(function () {
Expand Down Expand Up @@ -1440,14 +1440,15 @@ function isUndefined(arg) {
var undefined;

/** Used as the semantic version number. */
var VERSION = '4.17.20';
var VERSION = '4.17.21';

/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;

/** Error message constants. */
var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
FUNC_ERROR_TEXT = 'Expected a function';
FUNC_ERROR_TEXT = 'Expected a function',
INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';

/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
Expand Down Expand Up @@ -1580,10 +1581,11 @@ function isUndefined(arg) {
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
reHasRegExpChar = RegExp(reRegExpChar.source);

/** Used to match leading and trailing whitespace. */
var reTrim = /^\s+|\s+$/g,
reTrimStart = /^\s+/,
reTrimEnd = /\s+$/;
/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;

/** Used to match a single whitespace character. */
var reWhitespace = /\s/;

/** Used to match wrap detail comments. */
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
Expand All @@ -1593,6 +1595,18 @@ function isUndefined(arg) {
/** Used to match words composed of alphanumeric characters. */
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;

/**
* Used to validate the `validate` option in `_.template` variable.
*
* Forbids characters which could potentially change the meaning of the function argument definition:
* - "()," (modification of function parameters)
* - "=" (default value)
* - "[]{}" (destructuring of function parameters)
* - "/" (beginning of a comment)
* - whitespace
*/
var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;

/** Used to match backslashes in property paths. */
var reEscapeChar = /\\(\\)?/g;

Expand Down Expand Up @@ -2421,6 +2435,19 @@ function isUndefined(arg) {
});
}

/**
* The base implementation of `_.trim`.
*
* @private
* @param {string} string The string to trim.
* @returns {string} Returns the trimmed string.
*/
function baseTrim(string) {
return string
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
: string;
}

/**
* The base implementation of `_.unary` without support for storing metadata.
*
Expand Down Expand Up @@ -2754,6 +2781,21 @@ function isUndefined(arg) {
: asciiToArray(string);
}

/**
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
* character of `string`.
*
* @private
* @param {string} string The string to inspect.
* @returns {number} Returns the index of the last non-whitespace character.
*/
function trimmedEndIndex(string) {
var index = string.length;

while (index-- && reWhitespace.test(string.charAt(index))) {}
return index;
}

/**
* Used by `_.unescape` to convert HTML entities to characters.
*
Expand Down Expand Up @@ -13922,7 +13964,7 @@ function isUndefined(arg) {
if (typeof value != 'string') {
return value === 0 ? value : +value;
}
value = value.replace(reTrim, '');
value = baseTrim(value);
var isBinary = reIsBinary.test(value);
return (isBinary || reIsOctal.test(value))
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
Expand Down Expand Up @@ -16294,6 +16336,12 @@ function isUndefined(arg) {
if (!variable) {
source = 'with (obj) {\n' + source + '\n}\n';
}
// Throw an error if a forbidden character was found in `variable`, to prevent
// potential command injection attacks.
else if (reForbiddenIdentifierChars.test(variable)) {
throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
}

// Cleanup code by stripping empty strings.
source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
.replace(reEmptyStringMiddle, '$1')
Expand Down Expand Up @@ -16407,7 +16455,7 @@ function isUndefined(arg) {
function trim(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrim, '');
return baseTrim(string);
}
if (!string || !(chars = baseToString(chars))) {
return string;
Expand Down Expand Up @@ -16442,7 +16490,7 @@ function isUndefined(arg) {
function trimEnd(string, chars, guard) {
string = toString(string);
if (string && (guard || chars === undefined)) {
return string.replace(reTrimEnd, '');
return string.slice(0, trimmedEndIndex(string) + 1);
}
if (!string || !(chars = baseToString(chars))) {
return string;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "jshint",
"version": "2.13.3",
"version": "2.13.4",
"homepage": "http://jshint.com/",
"description": "Static analysis tool for JavaScript",
"author": {
Expand Down

0 comments on commit 61c868c

Please sign in to comment.