Skip to content

Commit 468bbc3

Browse files
parent
1 parent afdf37f commit 468bbc3

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

jslint.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3501,6 +3501,9 @@ stmt("throw", function () {
35013501
the_throw.disrupt = true;
35023502
the_throw.expression = expression(10);
35033503
semicolon();
3504+
if (functionage.try > 0) {
3505+
warn("unexpected_a", the_throw);
3506+
}
35043507
return the_throw;
35053508
});
35063509
stmt("try", function () {
@@ -3741,7 +3744,7 @@ function lookup(thing) {
37413744
}
37423745
the_variable = {
37433746
dead: false,
3744-
function: global,
3747+
parent: global,
37453748
id: thing.id,
37463749
init: true,
37473750
role: "variable",
@@ -4856,8 +4859,6 @@ export default function jslint(source, option_object, global_array) {
48564859
if (!option.white) {
48574860
whitage();
48584861
}
4859-
} else {
4860-
throw {"name": "JSLintError"};
48614862
}
48624863
}
48634864
if (!option.browser) {

report.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// report.js
2-
// 2018-05-14
2+
// 2018-06-19
33
// Copyright (c) 2015 Douglas Crockford (www.JSLint.com)
44

55
// Generate JSLint HTML reports.
66

77
/*property
8-
closure, column, context, edition, error, exports, filter, forEach, fudge,
9-
function, functions, global, id, froms, isArray, join, json, keys, length,
8+
closure, column, context, edition, error, exports, filter, forEach, froms,
9+
fudge, function, functions, global, id, isArray, join, json, keys, length,
1010
level, line, lines, message, module, name, names, option, parameters,
11-
property, push, replace, role, signature, sort, stop, warnings
11+
parent, property, push, replace, role, signature, sort, stop, warnings
1212
*/
1313

1414
const rx_amp = /&/g;
@@ -142,7 +142,7 @@ export default {
142142
let the_variable = context[id];
143143
return (
144144
the_variable.role === "variable"
145-
&& the_variable.function === the_function
145+
&& the_variable.parent === the_function
146146
);
147147
}));
148148
detail("exception", list.filter(function (id) {
@@ -152,18 +152,18 @@ export default {
152152
let the_variable = context[id];
153153
return (
154154
the_variable.closure === true
155-
&& the_variable.function === the_function
155+
&& the_variable.parent === the_function
156156
);
157157
}));
158158
detail("outer", list.filter(function (id) {
159159
let the_variable = context[id];
160160
return (
161-
the_variable.function !== the_function
162-
&& the_variable.function.id !== "(global)"
161+
the_variable.parent !== the_function
162+
&& the_variable.parent.id !== "(global)"
163163
);
164164
}));
165165
detail(mode, list.filter(function (id) {
166-
return context[id].function.id === "(global)";
166+
return context[id].parent.id === "(global)";
167167
}));
168168
detail("label", list.filter(function (id) {
169169
return context[id].role === "label";

0 commit comments

Comments
 (0)