Skip to content

Commit

Permalink
Fixes #9393, allow option to remove the com, org and net namespaces t…
Browse files Browse the repository at this point in the history
…hat rhino creates by default, but have the option be false by default -- it could cause havoc in a rhino-based server side system that uses the build code.
  • Loading branch information
jrburke committed Oct 4, 2009
1 parent 87979cc commit a1d3dc5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions buildscripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ load(buildScriptsPath + "jslib/i18nUtil.js");
//Convert arguments to keyword arguments.
var kwArgs = buildUtil.makeBuildOptions(arguments);

//Remove the default namespaces that are created by Rhino, but only
//if asked to -- it has bad consequences if the build system is used
//with other rhino-based server-side code.
if(kwArgs.removeDefaultNameSpaces){
delete com;
delete net;
delete org;
}

//Set logging level.
logger.level = kwArgs["log"];

Expand Down
6 changes: 6 additions & 0 deletions buildscripts/jslib/buildUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ buildUtil.DojoBuildOptions = {
defaultValue: "default",
helpText: "Select a DOM query engine. Default value is the normal dojo.query engine. Using query=sizzle will use the Sizzle engine."
+ "Normal Dojo tests are not run routinely with the Sizzle engine. See dojo/_base/sizzle.js for the version of Sizzle."
},
"removeDefaultNameSpaces": {
defaultValue: false,
helpText: "Removes the default 'com', 'org' and 'net' namespaces that are present in Rhino. This is hazardous to use if "
+ "the build system is used as part of a Rhino-based server-side solution, so use with caution. Weird build errors "
+ "might occur. Only use if your own code includes things in a com, org or net namespace."
}
};

Expand Down

0 comments on commit a1d3dc5

Please sign in to comment.