Skip to content

Commit

Permalink
Changed how we're initializing env.js to the newer style (which lets …
Browse files Browse the repository at this point in the history
…me turn off logging and inline script loading). Also rolled back some manual changes to env.js I'd made for Blue Ridge.
  • Loading branch information
Larry Karnowski committed Aug 22, 2009
1 parent 40ccd71 commit 7617cd8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
24 changes: 10 additions & 14 deletions lib/env.rhino.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,10 @@ var Envjs = function(){
* env.rhino.js
*/
(function($env){

// LJK: disabled logging
// $env.log = function(msg, level){
// print(' '+ (level?level:'LOG') + ':\t['+ new Date()+"] {ENVJS} "+msg);
// };

$env.log = function(msg, level){
print(' '+ (level?level:'LOG') + ':\t['+ new Date()+"] {ENVJS} "+msg);
};

$env.lineSource = function(e){
return e&&e.rhinoException?e.rhinoException.lineSource():"(line ?)";
Expand Down Expand Up @@ -615,13 +614,12 @@ var Envjs = function(){
"text/envjs" :true
};


// LJK: turning off loading of script files from HTML fixtures
// $env.loadInlineScript = function(script){
// var tmpFile = $env.writeToTempFile(script.text, 'js') ;
// $env.debug("loading " + tmpFile);
// $env.load(tmpFile);
// };

$env.loadInlineScript = function(script){
var tmpFile = $env.writeToTempFile(script.text, 'js') ;
$env.debug("loading " + tmpFile);
$env.load(tmpFile);
};

//injected by org.mozilla.javascript.tools.envjs.
$env.globalize = globalize;
Expand Down Expand Up @@ -8817,7 +8815,6 @@ $w.__defineGetter__("location", function(url){
* history.js
*/

$info("Initializing Window History.");
$currentHistoryIndex = 0;
$history = [];

Expand Down Expand Up @@ -10044,7 +10041,6 @@ var loadCookies = function(){
//We simply use the default ajax get to load the .cookies.js file
//if it doesn't exist we create it with a post. Cookies are maintained
//in memory, but serialized with each set.
$info("Loading Cookies");
try{
//TODO - load cookies
loadCookies();
Expand Down
6 changes: 5 additions & 1 deletion lib/test_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ if(BlueRidge.loaded != true) {

var BLUE_RIDGE_LIB_PREFIX = (environment["blue.ridge.prefix"] || "../../vendor/plugins/blue-ridge") + "/lib/";
require(BLUE_RIDGE_LIB_PREFIX + "env.rhino.js");
window.location = BlueRidge.CommandLine.fixtureFile;

Envjs(BlueRidge.CommandLine.fixtureFile, {
loadInlineScript: function(){},
log: function(){}
});

require(BLUE_RIDGE_LIB_PREFIX + "jquery-1.3.2.js");
require(BLUE_RIDGE_LIB_PREFIX + "jquery.fn.js");
Expand Down

0 comments on commit 7617cd8

Please sign in to comment.