[wp-trac] [WordPress Trac] #44371: Make sure all JS globals are explicitly assigned to the window.

WordPress Trac noreply at wordpress.org
Mon Oct 15 09:18:17 UTC 2018


#44371: Make sure all JS globals are explicitly assigned to the window.
--------------------------+-------------------------
 Reporter:  omarreiss     |       Owner:  omarreiss
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  5.1
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:  javascript
--------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:12 pento]:
 > @azaozz: Was [43579] the only change that needed to happen here?

 Yeah, assigning of the functions to vars in [43577] broke the order in
 quicktags.js a bit. The rest seems to be working.

 Paste this in the console:
 {{{
 test();
 function test() {
  console.log(1);
 }
 // 1

 window.test2();
 window.test2 = function() {
  console.log(2);
 }
 // ReferenceError: test2 is not defined.
 }}}

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


More information about the wp-trac mailing list