Skip to content

Commit

Permalink
I think there should be typeof predefined[v] !== 'boolean' instead of…
Browse files Browse the repository at this point in the history
… "predefined[v] !== 'boolean'" because predefined is a has with boolean values :)


Actually there is no need to check the type, better way is just "predefined[v] !== true"
  • Loading branch information
kof committed Nov 27, 2010
1 parent d98f753 commit a1c2a4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fulljslint.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4096,7 +4096,7 @@ loop: for (;;) {
// then we have an undefined variable.

} else if (funct['(global)']) {
if (option.undef && predefined[v] !== 'boolean') {
if (option.undef && typeof predefined[v] !== 'boolean') {
warning("'{a}' is not defined.", token, v);
}
note_implied(token);
Expand Down

2 comments on commit a1c2a4f

@marcelkorpel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you don't have to test for predefined[v] !== true, but could just use
!predefined[v]

@kof
Copy link
Owner Author

@kof kof commented on a1c2a4f Dec 1, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but it is not explicitly and conflicts with jslint ideas.

Please sign in to comment.