update jshint
This commit is contained in:
parent
7a607ba621
commit
491818bcc4
1 changed files with 114 additions and 63 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
define(function(require, exports, module) {
|
||||||
/*
|
/*
|
||||||
* JSHint, by JSHint Community.
|
* JSHint, by JSHint Community.
|
||||||
*
|
*
|
||||||
|
|
@ -32,8 +33,6 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define(function(require, exports, module) {
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
JSHINT is a global function. It takes two parameters.
|
JSHINT is a global function. It takes two parameters.
|
||||||
|
|
||||||
|
|
@ -160,7 +159,7 @@ define(function(require, exports, module) {
|
||||||
"(begin)", "(breakage)", "(context)", "(error)", "(global)",
|
"(begin)", "(breakage)", "(context)", "(error)", "(global)",
|
||||||
"(identifier)", "(last)", "(line)", "(loopage)", "(name)", "(onevar)",
|
"(identifier)", "(last)", "(line)", "(loopage)", "(name)", "(onevar)",
|
||||||
"(params)", "(scope)", "(statement)", "(verb)", "*", "+", "++", "-",
|
"(params)", "(scope)", "(statement)", "(verb)", "*", "+", "++", "-",
|
||||||
"--", "\/", "<", "<=", "==", "===", ">", ">=", ADSAFE, __filename, __dirname,
|
"--", "\/", "<", "<=", "==", "===", ">", ">=", $, ADSAFE, __filename, __dirname,
|
||||||
ActiveXObject, Array, Boolean, Buffer, COM, CScript, Canvas, CustomAnimation,
|
ActiveXObject, Array, Boolean, Buffer, COM, CScript, Canvas, CustomAnimation,
|
||||||
Date, Debug, E, Enumerator, Error, EvalError, FadeAnimation, Flash,
|
Date, Debug, E, Enumerator, Error, EvalError, FadeAnimation, Flash,
|
||||||
FormField, Frame, Function, HotKey, Image, JSON, LN10, LN2, LOG10E,
|
FormField, Frame, Function, HotKey, Image, JSON, LN10, LN2, LOG10E,
|
||||||
|
|
@ -172,8 +171,8 @@ define(function(require, exports, module) {
|
||||||
WScript, Web, Window, XMLDOM, XMLHttpRequest, "\\", a, abbr, acronym,
|
WScript, Web, Window, XMLDOM, XMLHttpRequest, "\\", a, abbr, acronym,
|
||||||
activeborder, activecaption, addEventListener, address, adsafe, alert,
|
activeborder, activecaption, addEventListener, address, adsafe, alert,
|
||||||
aliceblue, all, animator, antiquewhite, appleScript, applet, apply,
|
aliceblue, all, animator, antiquewhite, appleScript, applet, apply,
|
||||||
approved, appworkspace, aqua, aquamarine, area, arguments, arity,
|
approved, appworkspace, applicationCache, aqua, aquamarine, area, arguments,
|
||||||
article, aside, audio, autocomplete, azure, b, background,
|
arity, article, aside, audio, autocomplete, azure, b, background,
|
||||||
"background-attachment", "background-color", "background-image",
|
"background-attachment", "background-color", "background-image",
|
||||||
"background-position", "background-repeat", base, bdo, beep, beige, big,
|
"background-position", "background-repeat", base, bdo, beep, beige, big,
|
||||||
bisque, bitwise, black, blanchedalmond, block, blockquote, blue,
|
bisque, bitwise, black, blanchedalmond, block, blockquote, blue,
|
||||||
|
|
@ -192,22 +191,22 @@ define(function(require, exports, module) {
|
||||||
closeWidget, closed, closure, cm, code, col, colgroup, color, command,
|
closeWidget, closed, closure, cm, code, col, colgroup, color, command,
|
||||||
comment, condition, confirm, console, constructor, content,
|
comment, condition, confirm, console, constructor, content,
|
||||||
convertPathToHFS, convertPathToPlatform, coral, cornflowerblue,
|
convertPathToHFS, convertPathToPlatform, coral, cornflowerblue,
|
||||||
cornsilk, "counter-increment", "counter-reset", create, crimson, css, curly,
|
cornsilk, couch, "counter-increment", "counter-reset", create, crimson,
|
||||||
cursor, cyan, d, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen,
|
css, curly, cursor, cyan, d, darkblue, darkcyan, darkgoldenrod, darkgray,
|
||||||
darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred,
|
darkgreen, darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid,
|
||||||
darksalmon, darkseagreen, darkslateblue, darkslategray, darkturquoise,
|
darkred, darksalmon, darkseagreen, darkslateblue, darkslategray, darkturquoise,
|
||||||
darkviolet, data, datalist, dd, debug, decodeURI, decodeURIComponent,
|
darkviolet, data, datalist, dd, debug, decodeURI, decodeURIComponent,
|
||||||
deeppink, deepskyblue, defaultStatus, defineClass, del, deserialize,
|
deeppink, deepskyblue, defaultStatus, defineClass, del, deserialize,
|
||||||
details, devel, dfn, dialog, dimgray, dir, direction, display, div, dl,
|
details, devel, dfn, dialog, dimgray, dir, direction, display, div, dl,
|
||||||
document, dodgerblue, dt, edition, else, em, embed, embossed, empty,
|
document, dodgerblue, dt, edition, else, em, embed, embossed, emit, empty,
|
||||||
"empty-cells", encodeURI, encodeURIComponent, entityify, eqeqeq, errors,
|
"empty-cells", encodeURI, encodeURIComponent, entityify, eqeqeq, errors,
|
||||||
es5, escape, eval, event, evidence, evil, ex, exception, exec, exps, exports,
|
es5, escape, eval, event, evidence, evil, ex, exception, exec, exps, exports,
|
||||||
fieldset, figure, filesystem, firebrick, first, float, floor,
|
fieldset, figure, filesystem, FileReader, firebrick, first, float, floor,
|
||||||
floralwhite, focus, focusWidget, font, "font-family", "font-size",
|
floralwhite, focus, focusWidget, font, "font-family", "font-size",
|
||||||
"font-size-adjust", "font-stretch", "font-style", "font-variant",
|
"font-size-adjust", "font-stretch", "font-style", "font-variant",
|
||||||
"font-weight", footer, forestgreen, forin, form, fragment, frame,
|
"font-weight", footer, forestgreen, forin, form, fragment, frame,
|
||||||
frames, frameset, from, fromCharCode, fuchsia, fud, funct, function,
|
frames, frameset, from, fromCharCode, fuchsia, fud, funct, function,
|
||||||
functions, g, gainsboro, gc, getComputedStyle, ghostwhite, GLOBAL, global,
|
functions, g, gainsboro, gc, getComputedStyle, getRow, ghostwhite, GLOBAL, global,
|
||||||
globals, gold, goldenrod, gray, graytext, green, greenyellow, h1, h2,
|
globals, gold, goldenrod, gray, graytext, green, greenyellow, h1, h2,
|
||||||
h3, h4, h5, h6, handheld, hasOwnProperty, head, header, height, help,
|
h3, h4, h5, h6, handheld, hasOwnProperty, head, header, height, help,
|
||||||
hgroup, highlight, highlighttext, history, honeydew, hotpink, hr,
|
hgroup, highlight, highlighttext, history, honeydew, hotpink, hr,
|
||||||
|
|
@ -215,16 +214,16 @@ define(function(require, exports, module) {
|
||||||
implieds, in, inactiveborder, inactivecaption, inactivecaptiontext,
|
implieds, in, inactiveborder, inactivecaption, inactivecaptiontext,
|
||||||
include, indent, indexOf, indianred, indigo, infobackground, infotext,
|
include, indent, indexOf, indianred, indigo, infobackground, infotext,
|
||||||
init, input, ins, isAlpha, isApplicationRunning, isArray, isDigit,
|
init, input, ins, isAlpha, isApplicationRunning, isArray, isDigit,
|
||||||
isFinite, isNaN, ivory, join, jshint, JSHINT, json, kbd, keygen, keys, khaki,
|
isFinite, isNaN, ivory, join, jshint, JSHINT, json, jquery, jQuery, kbd,
|
||||||
konfabulatorVersion, label, labelled, lang, last, lavender,
|
keygen, keys, khaki, konfabulatorVersion, label, labelled, lang, last,
|
||||||
lavenderblush, lawngreen, laxbreak, lbp, led, left, legend,
|
lavender, lavenderblush, lawngreen, laxbreak, lbp, led, left, legend,
|
||||||
lemonchiffon, length, "letter-spacing", li, lib, lightblue, lightcoral,
|
lemonchiffon, length, "letter-spacing", li, lib, lightblue, lightcoral,
|
||||||
lightcyan, lightgoldenrodyellow, lightgreen, lightpink, lightsalmon,
|
lightcyan, lightgoldenrodyellow, lightgreen, lightpink, lightsalmon,
|
||||||
lightseagreen, lightskyblue, lightslategray, lightsteelblue,
|
lightseagreen, lightskyblue, lightslategray, lightsteelblue,
|
||||||
lightyellow, lime, limegreen, line, "line-height", linen, link,
|
lightyellow, lime, limegreen, line, "line-height", linen, link,
|
||||||
"list-style", "list-style-image", "list-style-position",
|
"list-style", "list-style-image", "list-style-position",
|
||||||
"list-style-type", load, loadClass, location, log, m, magenta, map,
|
"list-style-type", load, loadClass, localStorage, location, log, m, magenta,
|
||||||
margin, "margin-bottom", "margin-left", "margin-right", "margin-top",
|
map, margin, "margin-bottom", "margin-left", "margin-right", "margin-top",
|
||||||
mark, "marker-offset", maroon, match, "max-height", "max-width", maxerr,
|
mark, "marker-offset", maroon, match, "max-height", "max-width", maxerr,
|
||||||
maxlen, md5, mediumaquamarine, mediumblue, mediumorchid, mediumpurple,
|
maxlen, md5, mediumaquamarine, mediumblue, mediumorchid, mediumpurple,
|
||||||
mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise,
|
mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise,
|
||||||
|
|
@ -233,8 +232,8 @@ define(function(require, exports, module) {
|
||||||
moccasin, module, moveBy, moveTo, name, nav, navajowhite, navigator, navy, new,
|
moccasin, module, moveBy, moveTo, name, nav, navajowhite, navigator, navy, new,
|
||||||
newcap, noarg, node, noempty, noframes, nomen, nonew, noscript, nud, object, ol,
|
newcap, noarg, node, noempty, noframes, nomen, nonew, noscript, nud, object, ol,
|
||||||
oldlace, olive, olivedrab, on, onbeforeunload, onblur, onerror, onevar,
|
oldlace, olive, olivedrab, on, onbeforeunload, onblur, onerror, onevar,
|
||||||
onfocus, onload, onresize, onunload, opacity, open, openURL, opener, opera,
|
onfocus, onload, onresize, onunload, opacity, open, openDatabase, openURL, opener,
|
||||||
optgroup, option, orange, orangered, orchid, outer, outline, "outline-color",
|
opera, optgroup, option, orange, orangered, orchid, outer, outline, "outline-color",
|
||||||
"outline-style", "outline-width", output, overflow, "overflow-x",
|
"outline-style", "outline-width", output, overflow, "overflow-x",
|
||||||
"overflow-y", p, padding, "padding-bottom", "padding-left",
|
"overflow-y", p, padding, "padding-bottom", "padding-left",
|
||||||
"padding-right", "padding-top", "page-break-after", "page-break-before",
|
"padding-right", "padding-top", "page-break-after", "page-break-before",
|
||||||
|
|
@ -245,15 +244,15 @@ define(function(require, exports, module) {
|
||||||
prompt, prototype, pt, purple, push, px, q, quit, quotes, random, range,
|
prompt, prototype, pt, purple, push, px, q, quit, quotes, random, range,
|
||||||
raw, reach, readFile, readUrl, reason, red, regexp, reloadWidget,
|
raw, reach, readFile, readUrl, reason, red, regexp, reloadWidget,
|
||||||
removeEventListener, replace, report, require, reserved, resizeBy, resizeTo,
|
removeEventListener, replace, report, require, reserved, resizeBy, resizeTo,
|
||||||
resolvePath, resumeUpdates, rhino, right, rosybrown, royalblue, rp, rt,
|
resolvePath, resumeUpdates, respond, rhino, right, rosybrown, royalblue,
|
||||||
ruby, runCommand, runCommandInBg, saddlebrown, safe, salmon, samp,
|
rp, rt, ruby, runCommand, runCommandInBg, saddlebrown, safe, salmon, samp,
|
||||||
sandybrown, saveAs, savePreferences, screen, script, scroll, scrollBy,
|
sandybrown, saveAs, savePreferences, screen, script, scroll, scrollBy,
|
||||||
scrollTo, scrollbar, seagreen, seal, search, seashell, section, select,
|
scrollTo, scrollbar, seagreen, seal, search, seashell, section, send, select,
|
||||||
serialize, setInterval, setTimeout, shift, showWidgetPreferences,
|
serialize, setInterval, setTimeout, shift, showWidgetPreferences,
|
||||||
sienna, silver, skyblue, slateblue, slategray, sleep, slice, small,
|
sienna, silver, skyblue, slateblue, slategray, sleep, slice, small,
|
||||||
snow, sort, source, span, spawn, speak, speech, split, springgreen, src,
|
snow, sort, source, span, spawn, speak, speech, split, springgreen, src,
|
||||||
stack, status, steelblue, strict, strong, style, styleproperty, sub,
|
stack, status, start, steelblue, strict, strong, style, styleproperty, sub,
|
||||||
substr, sup, supplant, suppressUpdates, sync, system, table,
|
substr, sum, sup, supplant, suppressUpdates, sync, system, table,
|
||||||
"table-layout", tan, tbody, td, teal, tellWidget, test, "text-align",
|
"table-layout", tan, tbody, td, teal, tellWidget, test, "text-align",
|
||||||
"text-decoration", "text-indent", "text-shadow", "text-transform",
|
"text-decoration", "text-indent", "text-shadow", "text-transform",
|
||||||
textarea, tfoot, th, thead, thistle, threeddarkshadow, threedface,
|
textarea, tfoot, th, thead, thistle, threeddarkshadow, threedface,
|
||||||
|
|
@ -261,10 +260,10 @@ define(function(require, exports, module) {
|
||||||
toLowerCase, toString, toUpperCase, toint32, token, tomato, top, tr, tt,
|
toLowerCase, toString, toUpperCase, toint32, token, tomato, top, tr, tt,
|
||||||
tty, turquoise, tv, type, u, ul, undef, unescape, "unicode-bidi",
|
tty, turquoise, tv, type, u, ul, undef, unescape, "unicode-bidi",
|
||||||
unused, unwatch, updateNow, urls, value, valueOf, var, version,
|
unused, unwatch, updateNow, urls, value, valueOf, var, version,
|
||||||
"vertical-align", video, violet, visibility, watch, wheat, white,
|
"vertical-align", video, violet, visibility, watch, WebSocket, wheat, white,
|
||||||
"white-space", whitesmoke, widget, width, window, windowframe, windows,
|
"white-space", whitesmoke, widget, width, window, windowframe, windows,
|
||||||
windowtext, "word-spacing", "word-wrap", yahooCheckLogin, yahooLogin,
|
windowtext, Worker, "word-spacing", "word-wrap", yahooCheckLogin,
|
||||||
yahooLogout, yellow, yellowgreen, "z-index"
|
yahooLogin, yahooLogout, yellow, yellowgreen, "z-index"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*global exports: false */
|
/*global exports: false */
|
||||||
|
|
@ -321,9 +320,10 @@ var JSHINT = (function () {
|
||||||
boolOptions = {
|
boolOptions = {
|
||||||
adsafe : true, // if ADsafe should be enforced
|
adsafe : true, // if ADsafe should be enforced
|
||||||
bitwise : true, // if bitwise operators should not be allowed
|
bitwise : true, // if bitwise operators should not be allowed
|
||||||
boss : true, // if assignments inside if/for/while/do should be allowed
|
boss : true, // if advanced usage of assignments and == should be allowed
|
||||||
browser : true, // if the standard browser globals should be predefined
|
browser : true, // if the standard browser globals should be predefined
|
||||||
cap : true, // if upper case HTML should be allowed
|
cap : true, // if upper case HTML should be allowed
|
||||||
|
couch : true, // if CouchDB globals should be predefined
|
||||||
css : true, // if CSS workarounds should be tolerated
|
css : true, // if CSS workarounds should be tolerated
|
||||||
curly : true, // if curly braces around blocks should be required (even in if/for/while)
|
curly : true, // if curly braces around blocks should be required (even in if/for/while)
|
||||||
debug : true, // if debugger statements should be allowed
|
debug : true, // if debugger statements should be allowed
|
||||||
|
|
@ -334,6 +334,7 @@ var JSHINT = (function () {
|
||||||
forin : true, // if for in statements must filter
|
forin : true, // if for in statements must filter
|
||||||
fragment : true, // if HTML fragments should be allowed
|
fragment : true, // if HTML fragments should be allowed
|
||||||
immed : true, // if immediate invocations must be wrapped in parens
|
immed : true, // if immediate invocations must be wrapped in parens
|
||||||
|
jquery : true, // if jQuery globals should be predefined
|
||||||
laxbreak : true, // if line breaks should not be checked
|
laxbreak : true, // if line breaks should not be checked
|
||||||
newcap : true, // if constructor names must be capitalized
|
newcap : true, // if constructor names must be capitalized
|
||||||
noarg : true, // if arguments.caller and arguments.callee should be disallowed
|
noarg : true, // if arguments.caller and arguments.callee should be disallowed
|
||||||
|
|
@ -361,6 +362,7 @@ var JSHINT = (function () {
|
||||||
|
|
||||||
browser = {
|
browser = {
|
||||||
addEventListener: false,
|
addEventListener: false,
|
||||||
|
applicationCache: false,
|
||||||
blur : false,
|
blur : false,
|
||||||
clearInterval : false,
|
clearInterval : false,
|
||||||
clearTimeout : false,
|
clearTimeout : false,
|
||||||
|
|
@ -369,12 +371,14 @@ var JSHINT = (function () {
|
||||||
defaultStatus : false,
|
defaultStatus : false,
|
||||||
document : false,
|
document : false,
|
||||||
event : false,
|
event : false,
|
||||||
|
FileReader : false,
|
||||||
focus : false,
|
focus : false,
|
||||||
frames : false,
|
frames : false,
|
||||||
getComputedStyle: false,
|
getComputedStyle: false,
|
||||||
history : false,
|
history : false,
|
||||||
Image : false,
|
Image : false,
|
||||||
length : false,
|
length : false,
|
||||||
|
localStorage : false,
|
||||||
location : false,
|
location : false,
|
||||||
moveBy : false,
|
moveBy : false,
|
||||||
moveTo : false,
|
moveTo : false,
|
||||||
|
|
@ -388,6 +392,7 @@ var JSHINT = (function () {
|
||||||
onresize : true,
|
onresize : true,
|
||||||
onunload : true,
|
onunload : true,
|
||||||
open : false,
|
open : false,
|
||||||
|
openDatabase : false,
|
||||||
opener : false,
|
opener : false,
|
||||||
Option : false,
|
Option : false,
|
||||||
parent : false,
|
parent : false,
|
||||||
|
|
@ -403,10 +408,25 @@ var JSHINT = (function () {
|
||||||
setTimeout : false,
|
setTimeout : false,
|
||||||
status : false,
|
status : false,
|
||||||
top : false,
|
top : false,
|
||||||
|
WebSocket : false,
|
||||||
window : false,
|
window : false,
|
||||||
|
Worker : false,
|
||||||
XMLHttpRequest : false
|
XMLHttpRequest : false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
couch = {
|
||||||
|
"require" : false,
|
||||||
|
respond : false,
|
||||||
|
getRow : false,
|
||||||
|
emit : false,
|
||||||
|
send : false,
|
||||||
|
start : false,
|
||||||
|
sum : false,
|
||||||
|
log : false,
|
||||||
|
exports : false,
|
||||||
|
module : false
|
||||||
|
},
|
||||||
|
|
||||||
cssAttributeData,
|
cssAttributeData,
|
||||||
cssAny,
|
cssAny,
|
||||||
|
|
||||||
|
|
@ -752,6 +772,12 @@ var JSHINT = (function () {
|
||||||
inblock,
|
inblock,
|
||||||
indent,
|
indent,
|
||||||
jsonmode,
|
jsonmode,
|
||||||
|
|
||||||
|
jquery = {
|
||||||
|
'$' : false,
|
||||||
|
jQuery : false
|
||||||
|
},
|
||||||
|
|
||||||
lines,
|
lines,
|
||||||
lookahead,
|
lookahead,
|
||||||
member,
|
member,
|
||||||
|
|
@ -1102,26 +1128,32 @@ var JSHINT = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function assume() {
|
function assume() {
|
||||||
if (!option.safe) {
|
if (option.safe)
|
||||||
if (option.rhino) {
|
return;
|
||||||
combine(predefined, rhino);
|
|
||||||
}
|
if (option.couch)
|
||||||
if (option.node) {
|
combine(predefined, couch);
|
||||||
combine(predefined, node);
|
|
||||||
}
|
if (option.rhino)
|
||||||
if (option.devel) {
|
combine(predefined, rhino);
|
||||||
combine(predefined, devel);
|
|
||||||
}
|
if (option.node)
|
||||||
if (option.browser) {
|
combine(predefined, node);
|
||||||
combine(predefined, browser);
|
|
||||||
}
|
if (option.devel)
|
||||||
if (option.windows) {
|
combine(predefined, devel);
|
||||||
combine(predefined, windows);
|
|
||||||
}
|
if (option.browser)
|
||||||
if (option.widget) {
|
combine(predefined, browser);
|
||||||
combine(predefined, widget);
|
|
||||||
}
|
if (option.jquery)
|
||||||
}
|
combine(predefined, jquery);
|
||||||
|
|
||||||
|
if (option.windows)
|
||||||
|
combine(predefined, windows);
|
||||||
|
|
||||||
|
if (option.widget)
|
||||||
|
combine(predefined, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2429,10 +2461,10 @@ loop: for (;;) {
|
||||||
return node &&
|
return node &&
|
||||||
((node.type === '(number)' && +node.value === 0) ||
|
((node.type === '(number)' && +node.value === 0) ||
|
||||||
(node.type === '(string)' && node.value === '') ||
|
(node.type === '(string)' && node.value === '') ||
|
||||||
|
(node.type === 'null' && !option.boss) ||
|
||||||
node.type === 'true' ||
|
node.type === 'true' ||
|
||||||
node.type === 'false' ||
|
node.type === 'false' ||
|
||||||
node.type === 'undefined' ||
|
node.type === 'undefined');
|
||||||
node.type === 'null');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2538,22 +2570,30 @@ loop: for (;;) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function optionalidentifier() {
|
// fnparam means that this identifier is being defined as a function
|
||||||
|
// argument (see identifier())
|
||||||
|
function optionalidentifier(fnparam) {
|
||||||
if (nexttoken.identifier) {
|
if (nexttoken.identifier) {
|
||||||
advance();
|
advance();
|
||||||
if (option.safe && banned[token.value]) {
|
if (option.safe && banned[token.value]) {
|
||||||
warning("ADsafe violation: '{a}'.", token, token.value);
|
warning("ADsafe violation: '{a}'.", token, token.value);
|
||||||
} else if (token.reserved && !option.es5) {
|
} else if (token.reserved && !option.es5) {
|
||||||
warning("Expected an identifier and instead saw '{a}' (a reserved word).",
|
// `undefined` as a function param is a common pattern to protect
|
||||||
token, token.id);
|
// against the case when somebody does `undefined = true` and
|
||||||
|
// help with minification. More info: https://gist.github.com/315916
|
||||||
|
if (!fnparam || token.value != 'undefined') {
|
||||||
|
warning("Expected an identifier and instead saw '{a}' (a reserved word).",
|
||||||
|
token, token.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return token.value;
|
return token.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fnparam means that this identifier is being defined as a function
|
||||||
function identifier() {
|
// argument
|
||||||
var i = optionalidentifier();
|
function identifier(fnparam) {
|
||||||
|
var i = optionalidentifier(fnparam);
|
||||||
if (i) {
|
if (i) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
@ -2746,10 +2786,10 @@ loop: for (;;) {
|
||||||
/*
|
/*
|
||||||
* Parses a single block. A block is a sequence of statements wrapped in
|
* Parses a single block. A block is a sequence of statements wrapped in
|
||||||
* braces.
|
* braces.
|
||||||
*
|
*
|
||||||
* ordinary - true for everything but function bodies and try blocks.
|
* ordinary - true for everything but function bodies and try blocks.
|
||||||
* stmt - true if block can be a single statement (e.g. in if/for/while).
|
* stmt - true if block can be a single statement (e.g. in if/for/while).
|
||||||
*/
|
*/
|
||||||
function block(ordinary, stmt) {
|
function block(ordinary, stmt) {
|
||||||
var a,
|
var a,
|
||||||
b = inblock,
|
b = inblock,
|
||||||
|
|
@ -4176,9 +4216,14 @@ loop: for (;;) {
|
||||||
|
|
||||||
// The name is not defined in the function. If we are in the global scope,
|
// The name is not defined in the function. If we are in the global scope,
|
||||||
// then we have an undefined variable.
|
// then we have an undefined variable.
|
||||||
|
//
|
||||||
|
// Operators typeof and delete do not raise runtime errors even if the base
|
||||||
|
// object of a reference is null so no need to display warning if we're
|
||||||
|
// inside of typeof or delete.
|
||||||
|
|
||||||
} else if (funct['(global)']) {
|
} else if (funct['(global)']) {
|
||||||
if (option.undef && typeof predefined[v] !== 'boolean') {
|
if (anonname != 'typeof' && anonname != 'delete' &&
|
||||||
|
option.undef && typeof predefined[v] !== 'boolean') {
|
||||||
warning("'{a}' is not defined.", token, v);
|
warning("'{a}' is not defined.", token, v);
|
||||||
}
|
}
|
||||||
note_implied(token);
|
note_implied(token);
|
||||||
|
|
@ -4211,7 +4256,11 @@ loop: for (;;) {
|
||||||
warning("'{a}' is not allowed.", token, v);
|
warning("'{a}' is not allowed.", token, v);
|
||||||
note_implied(token);
|
note_implied(token);
|
||||||
} else if (typeof s !== 'object') {
|
} else if (typeof s !== 'object') {
|
||||||
if (option.undef) {
|
|
||||||
|
// Operators typeof and delete do not raise runtime errors even if the base object of
|
||||||
|
// a reference is null so no need to display warning if we're inside of typeof or delete.
|
||||||
|
|
||||||
|
if (anonname != 'typeof' && anonname != 'delete' && option.undef) {
|
||||||
warning("'{a}' is not defined.", token, v);
|
warning("'{a}' is not defined.", token, v);
|
||||||
} else {
|
} else {
|
||||||
funct[v] = true;
|
funct[v] = true;
|
||||||
|
|
@ -4772,7 +4821,7 @@ loop: for (;;) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (;;) {
|
for (;;) {
|
||||||
i = identifier();
|
i = identifier(true);
|
||||||
p.push(i);
|
p.push(i);
|
||||||
addlabel(i, 'parameter');
|
addlabel(i, 'parameter');
|
||||||
if (nexttoken.id === ',') {
|
if (nexttoken.id === ',') {
|
||||||
|
|
@ -5846,6 +5895,8 @@ loop: for (;;) {
|
||||||
};
|
};
|
||||||
itself.jshint = itself;
|
itself.jshint = itself;
|
||||||
|
|
||||||
|
itself.edition = '2011-02-19';
|
||||||
|
|
||||||
return itself;
|
return itself;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue