danwrong/loadrunner — pull request #24 by kennethkufluk (2012-07-24 21:58:01+00:00)
Title: AMD plugin fix

Assign a reference to the definition to the callback, to allow the AMD plugin to load relative paths properly.

We found that the AMD plugin tried to use a reference to the dependency instance.
Like so:

var def = new Loadrunner.Definition(id, function(exports) {
alert(def);
});

Since the definition body can be called during construction, 'def' is not yet defined.
To alleviate the problem, we added a reference to the definition as a property on the 'exports' function:

var def = new Loadrunner.Definition(id, function(exports) {
alert(exports.definition);
});

This passes the tests and works with our existing code.