Add globalScope hack to more reliably distinguish Node vs browser
Add globalScope hack to more reliably distinguish Node vs browser

See #2092: browser-based apps that have DOM nodes with the id
"global" were being detected as Node apps for purposes of assigning
moment to the runtime's global namespace.  This change is intended
to fix that issue for most practical use cases, hopefully without
breaking anyone's existing usage.

Algorithm:  If `global` is not defined, then we want to use
`window`.  If `global` is defined but `window` is not, then we want
to use `global`.  If both `global` and `window` are defined, then
we want to assign to `global` if `window === global.window` --
otherwise we assume that `global === window.global`, in which case
we want to assign to `window`.

iamstarkov/moment,yashanet/moment,rento41/moment,d0rc/moment,petrbela/moment,joelmukuthu/moment,bamatraf/moment,julionc/moment,suxuekun/moment,keigoleung/moment,ichernev/moment,Brandon-Royal/moment,lucidogen/moment,kidaa/moment,dardrone/moment,deepakrohan1/moment,iamstarkov/moment,davidyen1124/moment,nonmadden/moment,umurkontaci/moment,nurlan/moment,monoblaine/moment,mquandalle/moment,PKRoma/moment,syntheticgoo/moment,massic80/moment,Khan/moment,syntheticgoo/moment,StevenHeinrich/moment,kepta/moment,nonmadden/moment,xiebaochun/moment,nikolas/moment,PaulinePro/moment,CapeSepias/moment,jasonmendes/moment,pietercolpaert/moment,wesleifreitas/moment,Khan/moment,jeanmatheussouto/moment,hitesh97/moment,ksnabb/moment,Jeremy017/moment,Oiro/moment,jisaacks/moment,G-Grand/moment,mj1856/moment,moment/moment,BookingBug/moment,shuai959980629/moment,optimizely/moment,bici-zhuguangzu/moment,PKRoma/moment,DH0/moment,opdude/moment,kcthota/moment,Khamull/moment,evilemon/moment,BookingBug/moment,pietercolpaert/moment,mathiasrw/moment,evilemon/moment,shuai959980629/moment,prabhu5013/moment,Oiro/moment,grigorkh/moment,GerHobbelt/moment,moment/moment,daviYang/moment,gtanner/moment,bbc/moment,OtkurBiz/moment,gabrielmaldi/moment,maggiepint/moment,wesleifreitas/moment,samuelfullerthomas/moment,umurkontaci/moment,joelmheim/moment,samuelfullerthomas/moment,timothyfstephens/moment,mquandalle/moment,guanwanjun/moment,Jeremy017/moment,jaiminmoslake7020/moment,Brandon-Royal/moment,sonicparke/moment,julionc/moment,ebabel-eu/moment,billybonz1/moment,billybonz1/moment,etodd/moment,joelmheim/moment,supriyantomaftuh/moment,j6k4m8/moment,treyhunner/moment,kevinrodbe/moment,deepakrohan1/moment,jisaacks/moment,G-Grand/moment,smnbbrv/moment,mcauser/moment,bici-zhuguangzu/moment,julionc/moment,thehungrycoder/moment,prabhu5013/moment,topaxi/moment,IveWong/moment,PaulinePro/moment,raphamorim/moment,jawish/moment,PKRoma/moment,kcthota/moment,maggiepint/moment,AladdinSonni/moment,timothyfstephens/moment,ze-pequeno/moment,scriptrdotio/moment,mcanthony/moment,xkxx/moment,optimizely/moment,CapeSepias/moment,abbasmhd/moment,joelmheim/moment,zhil/moment,keigoleung/moment,whytobe/moment,wangjun/moment,sonicparke/moment,etodd/moment,samuelfullerthomas/moment,6ft-invsbl-rbbt/moment,djheart0710/moment,yblee85/moment,edivancamargo/moment,ThiagoGarciaAlves/moment,digitalavenueslimited/moment,kevinrodbe/moment,ThiagoGarciaAlves/moment,maggiepint/moment,scriptrdotio/moment,Aliccer/moment,dramalho/moment,d0rc/moment,calebcauthon/moment,bamatraf/moment,GerHobbelt/moment,poljeff/moment,nikolas/moment,mj1856/moment,suxuekun/moment,vnathalye/moment,opdude/moment,monoblaine/moment,kidaa/moment,calebcauthon/moment,ze-pequeno/moment,dardrone/moment,Khamull/moment,sigurdga/moment,DH0/moment,BlueSky1021/moment,bbc/moment,rento41/moment,guanwanjun/moment,marijaselakovic/moment,OtkurBiz/moment,gtanner/moment,ebabel-eu/moment,IveWong/moment,nurlan/moment,abbasmhd/moment,deskfed/moment,ze-pequeno/moment,mhijazi1/moment,Aliccer/moment,jaiminmoslake7020/moment,yblee85/moment,fdegiuli/moment,fdegiuli/moment,smnbbrv/moment,mathiasrw/moment,topaxi/moment,kepta/moment,vnathalye/moment,mcauser/moment,BlueSky1021/moment,rawbenny/moment,hhariri/moment,mhijazi1/moment,kimjji/moment,j6k4m8/moment,kimjji/moment,joelmukuthu/moment,StevenHeinrich/moment,edivancamargo/moment,Oire/moment,Acquisio/moment,zhil/moment,6ft-invsbl-rbbt/moment,whytobe/moment,digitalavenueslimited/moment,dramalho/moment,Acquisio/moment,gabrielmaldi/moment,calebcauthon/moment,sigurdga/moment,trungnghia112/moment,moment/moment,supriyantomaftuh/moment,xkxx/moment,raphamorim/moment,grigorkh/moment,daviYang/moment,hhariri/moment,SkReD/moment,djheart0710/moment,giobero999/moment,yashanet/moment,mcanthony/moment,wangjun/moment,poljeff/moment,Oire/moment,scriptrdotio/moment,petrbela/moment,ichernev/moment,rawbenny/moment,mj1856/moment,lucidogen/moment,xkxx/moment,jeanmatheussouto/moment,deskfed/moment,massic80/moment,treyhunner/moment,jawish/moment,AladdinSonni/moment,trungnghia112/moment,xiebaochun/moment,giobero999/moment,marijaselakovic/moment,OtkurBiz/moment,davidyen1124/moment,hitesh97/moment,jasonmendes/moment,Oire/moment,thehungrycoder/moment,ksnabb/moment