Questions tagged [spidermonkey]

SpiderMonkey is Mozilla's JavaScript and WebAssembly Engine. A highly tailored version of which executes JavaScript & WebAssembly in the Firefox web browser.

SpiderMonkey is Mozilla's JavaScript & WebAssembly Engine. A highly tailored and polished-to-fit version of SpiderMonkey executes JavaScript & WebAssembly in the Firefox web browser. SpiderMonkey is also the first JavaScript engine ever made.

This virtual machine (VM) is implemented in C++, Rust and JavaScript and has support for Just-In-Time (JIT) compilation on several major platforms.

Resources


Related tags

318 questions
13
votes
2 answers

How does event handling work internally within JavaScript?

Specifically Spidermonkey. I know you write functions and attach them to events to handle them. Where is the onClick handler defined and how does the JS engine know to fire onClick events when the user clicks? Any keywords, design patterns, links,…
Mad Rapper X
  • 311
  • 4
  • 16
13
votes
5 answers

Javascript Performance: Modulus operation of negative Number within decrementing loop slowing the code by more than 100%

I was going through Eloquent JavaScript (again) and came across exercise "Chess Board" of Chapter 2. I had my one decent version of solution written back in the day when I was first time reading it, and another version of solution provided at the…
Syed Huzaifa Hassan
  • 776
  • 1
  • 6
  • 22
13
votes
1 answer

javascript - catch SyntaxError and run alternate function

I'm trying to build something on javascript that I can have an input that can be everything like string, xml, javascript and (non-javascript string without quotes) as follows: //strings eval("'hello I am a string'"); /* note the following…
zanona
  • 12,345
  • 25
  • 86
  • 141
13
votes
2 answers

Will Function.prototype.bind() always be slow?

I am writing an open source javascript library, and I use .bind() method heavily, because I have an idea that object-oriented code looks more clear then. (debatable, though) Example A1: var that = this; setTimeout(function () { …
Dan
  • 55,715
  • 40
  • 116
  • 154
12
votes
2 answers

What is the difference between Rhino and Spidermonkey JavaScript engines?

For the first time, I began learning Javascript, however on the start I stuck up with two possible options: Rhino and Spidermonkey. Could you please, tell me what is one, and what is another, so I can easily choose for myself the best option that…
Dzek Trek
  • 338
  • 3
  • 14
12
votes
3 answers

What are the key semantic differences between Ruby and Javascript

If one were to implement Ruby on top of a Javascript engine (either in the browser or on top of standalone V8 or Spidermonkey), what would be the key impedance mismatches between the Ruby and JS object models ?
Nick Main
  • 1,440
  • 8
  • 15
12
votes
2 answers

E4X with NodeJS

Is there any way to get E4X(ECMAScript) to work with NodeJS? It would really help to output slick html/xml without hassle/noise. It works fine using SpiderMonkey since it is natively implemented, but it doesn't seem to work with NodeJS. using…
zanona
  • 12,345
  • 25
  • 86
  • 141
11
votes
3 answers

If you try 9n**9n**9n in Chrome's console, Chrome breaks (it resembles an infinite loop). Why does this happen?

If you try 9n**9n**9n in Chrome's console, Chrome breaks (it resembles an infinite loop). Does the V8 engine lack the implementation for this case? I mean, if you try 9**9**9 it will return Infinity, which is kind of nice. Why doesn't V8…
Tiberiu
  • 418
  • 1
  • 3
  • 12
11
votes
2 answers

Javascript stack model for generators

While I was using javascript generators to implement a debugger for a small scheme interpreter I starting wondering about the stack model in e.g. the chrome javascript engine. Normally It's enough to have one stack for function call frames. In case…
paweloque
  • 18,466
  • 26
  • 80
  • 136
11
votes
2 answers

why Firefox runs this code 10x faster than Chrome

I need to run this code on WebKit, it's a part of a hybrid app for android: for(var x = 0; x < width; x++) { for(var y = 0; y < height; y++) { var i = (y * width + x) * 3; var r = data[i]; var g = data[i + 1]; var…
iman
  • 21,202
  • 8
  • 32
  • 31
9
votes
2 answers

pkg-config fails to find package under sysroot directory

Can anyone please tell me why this might fail: afeder@ubuntu:~/android/toolchain/sysroot$ ls…
Anders Feder
  • 595
  • 2
  • 5
  • 18
9
votes
3 answers

Does creating functions consume more memory

// Case A function Constructor() { this.foo = function() { ... }; ... } // vs // Case B function Constructor() { ... }; Constructor.prototype.foo = function() { ... } One of the main reasons people advise the use of prototypes is…
Raynos
  • 166,823
  • 56
  • 351
  • 396
9
votes
2 answers

How can I get the full backtrace in SpiderMonkey (JSAPI) from my reportError function?

I'm embedding javascript in my app using spidermonkey and I have a function called reportError that receives a JSErrorReport. It seems simple to grab the current line of the error, but is it possible to get the entire call path to display a full…
Chris Farmiloe
  • 13,935
  • 5
  • 48
  • 57
9
votes
4 answers

Debug javascript using Eclipse

Ok, this is some question...well, I haven't seeing in any other place a question like this one... I need to debug a javascript file through Eclipse (Helios)...but, that is not all, the javascript file is called by a third party application (C/C++)…
marcoaoteixeira
  • 505
  • 2
  • 14
8
votes
2 answers

MongoDB SpiderMonkey doesn't understand UTF-8

If I add non-ASCII characters to MongoDB database then all db.find() fail telling "non ascii character detected". It's problem of SpiderMonkey, I have to rebuild it with UTF-8 support. I've tried to do it like…
luchaninov
  • 6,792
  • 6
  • 60
  • 75
1
2
3
21 22