#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/[email protected], 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 7 years ago by
comment:2 Changed 7 years ago by
Cc: | cjolif added |
---|
comment:7 Changed 6 years ago by
Milestone: | tbd → 1.7.6 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:9 Changed 6 years ago by
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.
PS: posted https://groups.google.com/forum/#!topic/amd-implement/OkUXYTAgCwM for discussion about the RequireJS behavior.