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
223
votes
21 answers

Embedding JavaScript engine into .NET

just wondering if anyone has ever tried embedding and actually integrating any js engine into the .net environment. I could find and actually use (after a LOT of pain and effort, since it's pretty outdated and not quite finished) spidermonkey-dotnet…
aprilchild
  • 566
  • 3
  • 5
  • 7
84
votes
4 answers

How can I get the memory address of a JavaScript variable?

Is it possible to find the memory address of a JavaScript variable? The JavaScript code is part of (embedded into) a normal application where JavaScript is used as a front end to C++ and does not run on the browser. The JavaScript implementation…
vivekian2
  • 3,795
  • 9
  • 35
  • 41
75
votes
5 answers

How do I get console input in spidermonkey JavaScript?

I'm currently using spidermonkey to run my JavaScript code. I'm wondering if there's a function to get input from the console similar to how Python does this: var = raw_input() Or in C++: std::cin >> var; I've looked around and all I've found so…
camel_space
  • 1,057
  • 1
  • 7
  • 10
71
votes
5 answers

Javascript Engines Advantages

I am confused about JavaScript engines right now. I know that V8 was a big deal because it compiled JavaScript to native code. Then I started reading about Mozilla SpiderMonkey, which from what I understand is written in C and can compile…
Jan
  • 719
  • 1
  • 6
  • 3
53
votes
2 answers

Different results using the same maths in different browsers

Edit: since chrome has updated the browser - this question is some what redundant as they have fixed an internal bug which means this problem no longer occurs. I have an animation of a circle anchored to the center of the canvas. The larger the…
Sir
  • 8,135
  • 17
  • 83
  • 146
38
votes
5 answers

How does setInterval and setTimeout work?

I was in an awkward situation, I am working with pure JavaScript for almost 3 years, and I know that JavaScript is single-threaded language, and that you can simulate asynchronous execution using setInterval and setTimeout functions, but when I…
Taron Mehrabyan
  • 2,199
  • 2
  • 20
  • 27
32
votes
2 answers

Under the hood, are Javascript objects hash tables?

I was wondering about how Objects are implemented under the hood in Javascript engines (V8, Spidermonkey, etc). Are they really just Hash Tables? If so, how do they handle collisions?
Newtang
  • 6,414
  • 10
  • 49
  • 70
24
votes
3 answers

rhino vs spidermonkey

I noticed ubuntu 10.04 removed the spidermonkey package. Rhino looks like it's still there though. What are the differences between rhino and spidermonkey (besides what language they're written in). And why did they remove spidermonkey?
Tyler Gillies
  • 1,857
  • 4
  • 22
  • 31
24
votes
2 answers

Is Javascript substring virtual?

If we have a huge string, named str1, say 5 million characters long, and then str2 = str1.substr(5555, 100) so that str2 is 100 characters long and is a substring of str1 starting at 5555 (or any other randomly selected position). How JavaScript…
exebook
  • 32,014
  • 33
  • 141
  • 226
21
votes
2 answers

Are JavaScript Arrays actually implemented as arrays?

The difference between a JavaScript Array, and Object is not very big. In fact it seems Array mainly adds the length field, so you can use both Arrays and Objects as numeric arrays: var ar = new Array(); ar[0] = "foo"; ar["bar"] = "foo"; var ob =…
Timmmm
  • 88,195
  • 71
  • 364
  • 509
19
votes
2 answers

Linking a C++ program with SpiderMonkey?

I successfully compiled spidermonkey (on windows), how can I link against it now (to embed it)? js-config is not properly installed, and I don't understand this workaround. Linking to the static library should be easier, but I don't even know which…
arthur.sw
  • 11,052
  • 9
  • 47
  • 104
16
votes
5 answers

Best way to get spidermonkey js on Ubuntu?

I need to install the Spidermonkey JS engine on my work machine. The project I'm working on has a jslint script that requires Spidermonkey or a similar js binary. I've tried compiling Spidermonkey from source and gotten stuck in dependency hell. I…
ovrkenthousand
  • 478
  • 1
  • 4
  • 9
16
votes
1 answer

Writing high-performance Javascript code without getting deoptimised

When writing performance-sensitive code in Javascript which operates on large numeric arrays (think a linear algebra package, operating on integers or floating-point numbers), one always wants the the JIT to help out as much as possible. Roughly…
Joppy
  • 363
  • 2
  • 12
16
votes
2 answers

How to inherit a C++ class in JavaScript?

I am embedding SpiderMonkey to make my C++ library scriptable. To make it extendable, I need it possible to define a new class (JavaScript) inheriting one C++ base class of the library. Is there an example showing me how to do that using…
ims
  • 161
  • 3
15
votes
3 answers

Click on a javascript link within python?

I am navigating a site using python's mechanize module and having trouble clicking on a javascript link for next page. I did a bit of reading and people suggested I need python-spidermonkey and DOMforms. I managed to get them installed by I am not…
Lostsoul
  • 25,013
  • 48
  • 144
  • 239
1
2 3
21 22