MoinMoin Logo
  • Comments
  • Immutable Page
  • Menu
    • Navigation
    • RecentChanges
    • FindPage
    • Local Site Map
    • Help
    • HelpContents
    • HelpOnMoinWikiSyntax
    • Display
    • Attachments
    • Info
    • Raw Text
    • Print View
    • Edit
    • Load
    • Save
  • Login

Navigation

  • Start
  • Sitemap
Revision 4 as of 2016-08-18 15:43:43
  • Javascript
  • SpiderMonkey

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:

  • chmod 755 test.js
  • ./test.js

SpiderMonkey is installed on Slackware 14.

Windows binary

  • https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/jsshell-win64.zip

  • MoinMoin Powered
  • Python Powered
  • GPL licensed
  • Valid HTML 4.01