Skip to content

Commit

Permalink
Support for runtime loading the test version of a package.
Browse files Browse the repository at this point in the history
  • Loading branch information
hugow committed Jun 20, 2012
1 parent 783139e commit e73b0e6
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/pillow.js
Expand Up @@ -283,7 +283,13 @@ define.pillow = {
}
},
// load a package
loadPackage: function (packageName, optionalApplicationDomain, reload, cb) {
loadPackage: function (
packageName,
optionalApplicationDomain,
reload,
forTesting,
cb
) {
optionalApplicationDomain = optionalApplicationDomain ||
this.getTopmostDomain();
var script,
Expand Down Expand Up @@ -327,7 +333,11 @@ define.pillow = {
script = document.createElement('script');
body = document.getElementsByTagName('body')[0];
body.appendChild(script);
script.src = packageName + '/' + packageName + '.js';
script.src = packageName +
'/' +
packageName +
(forTesting ? '.test.js' : '.js');

script.onload = function () {
// we should load the dependencies
that.loadDependencies(
Expand Down

0 comments on commit e73b0e6

Please sign in to comment.