Changeset 9287

Show
Ignore:
Timestamp:
10/06/08 15:23:23 (1 month ago)
Author:
hannes
Message:

Add global print() function that is compatible with the one in spidermonkey and rhino shells.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • helma-ng/trunk/modules/global.js

    r9286 r9287  
    8080 
    8181    /** 
     82     * Basic print function compatible with other JavaScript implementations. 
     83     */ 
     84    this.print = function() { 
     85        for (var i = 0; i < arguments.length; i++) { 
     86            out.print(arguments[i]); 
     87            if (i < arguments.length) { 
     88                out.print(' '); 
     89            } 
     90        } 
     91        out.println(); 
     92    } 
     93 
     94    var out = java.lang.System.out; 
     95 
     96    /** 
    8297     * Get the org.mozilla.javascript.Context associated with the current thread. 
    8398     */