SpiderMonkey

SpiderMonkey is Mozilla's Javascript engine written in C/C++. It is used in various Mozilla products, including Firefox, and is available under the MPL2.

Example code

   1 #!/usr/bin/js
   2 function CTest(){
   3   this.counter=0;
   4 }
   5 
   6 
   7 CTest.prototype.increment=function(){
   8   this.counter++;
   9 };
  10 
  11 CTest.prototype.show=function(){
  12   putstr(this.counter);
  13   putstr("\r\n");
  14 };
  15 
  16 var c = new CTest();
  17 var d = new CTest();
  18 c.increment();
  19 c.increment();
  20 c.increment();
  21 c.show();
  22 
  23 d.increment();
  24 d.increment();
  25 d.show();

Run it with:

SpiderMonkey is installed on Slackware 14.

Windows binary

Javascript/SpiderMonkey (last edited 2016-08-18 15:43:43 by localhost)