Skip to content

Commit

Permalink
Renaming Java method for comprehension: globalize() => getFreshScopeO…
Browse files Browse the repository at this point in the history
…bj()
  • Loading branch information
gleneivey committed Sep 18, 2009
1 parent 2cafc6e commit 0016574
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions rhino/src/org/mozilla/javascript/tools/envjs/Window.java
Expand Up @@ -28,7 +28,7 @@ public void init(Context cx)

// now, we add the JavaScript methods we want to provide for env.js
String[] names = {
"globalize",
"getFreshScopeObj",
"getScope",
"setScope",
"configureScope",
Expand Down Expand Up @@ -73,10 +73,10 @@ public static void load(Context cx, Scriptable thisObj,
}


public static Scriptable globalize( Context cx,
Scriptable thisObj,
Object[] args,
Function funObj)
public static Scriptable getFreshScopeObj( Context cx,
Scriptable thisObj,
Object[] args,
Function funObj)
{
org.mozilla.javascript.tools.shell.Global gObj =
(org.mozilla.javascript.tools.shell.Global)
Expand Down
10 changes: 5 additions & 5 deletions src/platform/core.js
Expand Up @@ -67,8 +67,8 @@ var Envjs = function(){
// for manipulating the JavaScript scope chain, put in trivial emulations
$env.debug("performing check for custom Java methods in env-js.jar");
var countOfMissing = 0, dontCare;
try { dontCare = globalize; }
catch (ex){ globalize = function(){ return {}; };
try { dontCare = getFreshScopeObj; }
catch (ex){ getFreshScopeObj = function(){ return {}; };
countOfMissing++; }
try { dontCare = getScope; }
catch (ex){ getScope = function(){}; countOfMissing++; }
Expand Down Expand Up @@ -198,7 +198,7 @@ var Envjs = function(){
$env.loadInlineScript = function(script){};


$env.globalize = function(){};
$env.getFreshScopeObj = function(){};
$env.getScope = function(){};
$env.setScope = function(){};
$env.configureScope = function(){};
Expand Down Expand Up @@ -237,7 +237,7 @@ var Envjs = function(){
};

$env.makeNewWindowMaybeLoad = function(openingWindow, parentArg, url){
var newWindow = $env.globalize();
var newWindow = $env.getFreshScopeObj();

var local__window__ = $env.window,
local_env = $env,
Expand All @@ -258,7 +258,7 @@ var Envjs = function(){

var scopes = recordScopesOfKeyObjects(inNewContext);
setScopesOfKeyObjects(inNewContext, newWindow);
inNewContext(); // invoke local fn to window-ify object from globalize()
inNewContext(); // invoke local fn to window-ify new scope object
restoreScopesOfKeyObjects(inNewContext, scopes);
return newWindow;
};
Expand Down
2 changes: 1 addition & 1 deletion src/platform/rhino.js
Expand Up @@ -355,7 +355,7 @@
};

//injected by org.mozilla.javascript.tools.envjs.
$env.globalize = globalize;
$env.getFreshScopeObj = getFreshScopeObj;
$env.getScope = getScope;
$env.setScope = setScope;
$env.configureScope = configureScope;
Expand Down

0 comments on commit 0016574

Please sign in to comment.