Size: 685
Comment:
|
Size: 841
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## page was renamed from SpiderMonkey | |
Line 38: | Line 39: |
== Windows binary == * https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/jsshell-win64.zip |
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.