[wp-trac] [WordPress Trac] #28236: JSHint `onevar` arg is being deprecated and dropped

WordPress Trac noreply at wordpress.org
Wed May 14 17:40:48 UTC 2014


#28236: JSHint `onevar` arg is being deprecated and dropped
------------------------------+-----------------------------
 Reporter:  georgestephanis   |       Owner:
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Future Release
Component:  Build/Test Tools  |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  dev-feedback      |     Focuses:  javascript
------------------------------+-----------------------------

Comment (by azaozz):

 Replying to [comment:2 scott.gonzalez]:
 > The use of `onevar` doesn't affect actual code quality or prevent
 bugs...

 That's not exactly true. Example:

 {{{
 var a = 1;
 function test() {
   console.log(a);
   var a = 2;
 }
 test();
 }}}

 Can you guess what `a` would be before it is defined in local scope? :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28236#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list