Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
danwrong committed May 14, 2012
1 parent 3354022 commit e9f1149
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@
factory = args.shift();

var def = new loadrunner.Definition(id, function(exports) {
var mods = [];
var mods = [], thisDef = this;

function executeAMD() {
var args = mapArgs(makeArray(dependencies), def), exported;
var args = mapArgs(makeArray(dependencies), thisDef), exported;

if (typeof factory == 'function') {
exported = factory.apply(def, args);
exported = factory.apply(thisDef, args);
} else {
exported = factory;
}

if (typeof exported == 'undefined') {
exported = def.exports;
exported = thisDef.exports;
}

exports(exported);
Expand All @@ -90,7 +90,7 @@
for (var i=0, len=dependencies.length; i < len; i++) {
var d = dependencies[i];
if (indexOf(['require', 'exports', 'module'], d) == -1) {
mods.push(resolve(d, def));
mods.push(resolve(d, thisDef));
}
}

Expand Down

0 comments on commit e9f1149

Please sign in to comment.