Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#17829 closed defect (fixed)

dojo.global doesn't point to window w/latest RequireJS

Reported by: bill Owned by:
Priority: undecided Milestone: 1.7.6
Component: Core Version: 1.7.0
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

dojo/_base/kernel.js defines dojo.global as this:

define(["../has", "./config", "require", "module"], function(has, config, require, module){
... 
        dojo = {
            global:this,
            ...
        };
...

The meaning of this in AMD callbacks is apparently not defined, and starting with jrburke/requirejs@fef207e, RequireJS sets it to the exports object rather than to window.

This will break various things in dojo, such as dojo.getObject() and the parser handling globals, ex: <div data-dojo-type=dijit/Tree store=globalStore>.

Probably we should get the real global object via (function(){ return this; })() rathern than this.

Change History (9)

comment:1 Changed 5 years ago by bill

PS: posted https://groups.google.com/forum/#!topic/amd-implement/OkUXYTAgCwM for discussion about the RequireJS behavior.

comment:2 Changed 5 years ago by cjolif

Cc: cjolif added

comment:3 Changed 5 years ago by Colin Snover <github.com@…>

In 27533ab2144f77ecd5baebc7be1b079ca2446aef/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:4 Changed 5 years ago by Colin Snover <github.com@…>

In 1fee2371205ed90bfbb48faf393758dfe0268ff3/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:5 Changed 5 years ago by Colin Snover <github.com@…>

In 523c19d973187e8966ca7c954c5b48d5bc0f371e/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:6 Changed 5 years ago by Colin Snover <github.com@…>

In 4a9fb88f4ed230f10a741e2c8745b491c374e575/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:7 Changed 5 years ago by Colin Snover

Milestone: tbd1.7.6
Resolution: fixed
Status: newclosed

comment:8 Changed 5 years ago by Colin Snover <github.com@…>

In 45049b9648dac95d9ba0f23eb090d7794bb9473b/dojox:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:9 Changed 5 years ago by bill

Thanks for the fixes.

Looks like the important change is actually in https://github.com/dojo/dojo/commit/fa4028b647e38d4f1cc183e6db65022f80cb5423 (and probably backports too).

Note: See TracTickets for help on using tickets.