Permalink
Browse files

I think there should be typeof predefined[v] !== 'boolean' instead of…

… "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 a1c2a4f03679888f912e4c101e2e6bb171ba3a96
Showing with 1 addition and 1 deletion.
  1. +1 −1 fulljslint.js
View
2 fulljslint.js 100755 → 100644
@@ -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);

2 comments on commit a1c2a4f

@marcelkorpel

This comment has been minimized.

Show comment
Hide comment
@marcelkorpel

marcelkorpel Dec 1, 2010

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

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

@kof

This comment has been minimized.

Show comment
Hide comment
@kof

kof Dec 1, 2010

Owner

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

Owner

kof replied Dec 1, 2010

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

Please sign in to comment.