Skip to content

Commit

Permalink
declare a global require for dojo
Browse files Browse the repository at this point in the history
when dojo 1.7's "main module" (dojo/main.js) is loaded, it loads dojo/_base/browser which fails if there's no global `require`
  • Loading branch information
John Hann committed Apr 9, 2012
1 parent 5077d8a commit af1db3f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/curl/shim/dojo16.js
Expand Up @@ -20,6 +20,7 @@
* });
*
*/
var require;
define(/*=='curl/shim/dojo16',==*/ ['curl/_privileged', 'curl/domReady'], function (priv, domReady) {
"use strict";

Expand All @@ -45,6 +46,11 @@ define(/*=='curl/shim/dojo16',==*/ ['curl/_privileged', 'curl/domReady'], functi
// as a dependency
duckPunchRequire(_curl);

// dojo 1.7 still expects a global `require`, so make sure they've got one
if (typeof require == 'undefined') {
require = _curl;
}

// override executeDefFunc to override "require" deps
priv['core'].executeDefFunc = function (def) {
duckPunchRequire(def.require);
Expand Down

0 comments on commit af1db3f

Please sign in to comment.