Show
Ignore:
Timestamp:
01/08/08 01:40:45 (5 years ago)
Author:
nshuyo
Message:

lang/javascript/jsruby: ensured for non browser environment ( spidermonkey/rhino/yahoo widgets )

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/jsruby/trunk/src/interpreter.js

    r4176 r4193  
    77RubyEngine.Scope.prototype.popLevel = function(){ this.level.pop(); } 
    88RubyEngine.Scope.prototype.clear = function(){ 
    9   this.level = [{}] 
    10   this.stack = [] 
    11   this.global = { "$window": new RubyEngine.RubyObject.JSObject(window), "$document": new RubyEngine.RubyObject.JSObject(document) } 
     9  this.level = [{}]; 
     10  this.stack = []; 
     11  this.global = {}; 
     12  if (typeof(window)!='undefined') this.global={"$window": new RubyEngine.RubyObject.JSObject(window), "$document": new RubyEngine.RubyObject.JSObject(document) }; 
    1213  for(var i in RubyEngine.Interpreter.KernelMethod) { 
    1314    if (i.match(/^[a-z_\*]/)) this.global[i] = RubyEngine.Interpreter.KernelMethod[i];