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
5
votes
1 answer

apply function in JavaScript

I'm learning JavaScript and I'm currently trying to figure out why (in Spidermonkey) [].concat.apply([1], [[2]]) returns the expected [1, 2], but Array.concat.apply([1], [[2]]) returns [2] instead of [1, 2]. Could someone provide a good…
eljenso
  • 16,789
  • 6
  • 57
  • 63
5
votes
1 answer

Modifying V8 JavaScript Engine provided with Chrome

I want support for a new API that is normally not supported by V8 JS Engine provided with Chrome. Is it possible to do this by tweaking V8 provided with Chrome. I'm open to using Spidermonkey which is provided with Firefox. I just want this API to…
5
votes
2 answers

What does this mean in Mozilla: "let blocks and let expressions are obsolete"

I bumped into a few statements from people that "let blocks and let expressions are obsolete" in SpiderMonkey, while there's very little information about it. I'm wondering what does this exactly mean? Isn't the "let" statement a popular new feature…
Xun Yang
  • 4,209
  • 8
  • 39
  • 68
5
votes
3 answers

JavaScript experts: Do block-scopes with `{}` and anonymous functions both help garbage-collection?

In the book "You don't know JS: scopes & closures", Kyle simpson states that a block-scoped variable helps with garbage collection, here is the specific example: function process(data) { // do something interesting } { let someReallyBigData =…
doubleOrt
  • 2,407
  • 1
  • 14
  • 34
5
votes
1 answer

Why does using toString() on a float give different results in Firefox vs Chrome vs IE?

If you run this code in Firefox and Chrome, it will output a different converted string. (0.1234).toString(36) In Firefox it will return a value of "0.4fxcm49g2j8" In Chrome or Node 4+ (likely a V8 difference), I get a value of…
Cameron
  • 1,524
  • 11
  • 21
5
votes
2 answers

Why Placing #include BEFORE include guards

Is there any valid reason for placing #include directives BEFORE the include guards in a header file like this: #include "jsarray.h" #include "jsanalyze.h" #include "jscompartment.h" #include "jsgcmark.h" #include "jsinfer.h" #include…
JavaMan
  • 4,954
  • 4
  • 41
  • 69
5
votes
1 answer

How to get javascript caller source line number in SpiderMonkey JSNative callback?

I want to implement a C++ function working like console.log. I need to know javascript caller's source line position in C++. I search MDN JSAPI/JS Debugger API documents but no result. A concept usage in javascript. console.log("blahblahblah"); And…
huandu
  • 128
  • 6
5
votes
1 answer

How can I determine the JavaScript Engine from .js code?

Is there a way using JavaScript code to know what JavaScript Engine, is the one on which that code is run on? I don't want to get the browser type just the JavaScript engine.
Eduard Florinescu
  • 16,747
  • 28
  • 113
  • 179
5
votes
2 answers

Can I execute a Javascript function inside Spidermonkey and get the return value?

I'm just getting into using Delphi with Spidermonkey. Previously I would load a web page into a TWebBrowser component and interact with the Javascript code in the loaded web page. This was messy because to return values back to delphi I had to…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
4
votes
3 answers

Spidermonkey bytecode documentation

I am looking for quite some time a documentation for all the spidermonkey's bytecodes, or at least something that tells me in general what a bytecode's purpose is. Does anyone can recommend such resource? Thanks!
TCS
  • 5,790
  • 5
  • 54
  • 86
4
votes
1 answer

When and How JavaScript garbage collector works

I did read few articles like this on MDN and this one I got the idea of how GC happens in JavaScript I still don't understand things like a) When does Garbage collector kicks in ( it gets called after some interval or some conditions have to met)…
Tripurari Shankar
  • 3,308
  • 1
  • 15
  • 24
4
votes
2 answers

Once again: How to get DOM in JavaScript Engine? Has this somebody done?

There are several questions and tips about getting the DOM into Spider-, Trace- or JaegerMonkey. But has anyone done this? Is somewhere out there a in C embedable working JS-Engine including the DOM? OR at least a easy to do tutorial?
christian
  • 425
  • 5
  • 15
4
votes
2 answers

Segmentation Fault using libmozjs-52 (SpiderMonkey) under Linux x64

I'm trying to use libmozjs (SpiderMonkey) under Linux x64 (Ubuntu 17.04). However, something goes wrong at the very first steps. The SpiderMonkey project has no bug tracker, also after using Google very hard I didn't find any workaround about my…
tumick
  • 105
  • 5
4
votes
1 answer

Typedef redefinition (C2371) for uint32 in two 3rd-party libraries

In my application I am using Box2D and Spidermonkey. Both libraries are defining the type uint32, which obviously gives me a compiler-error when using both in the same compilation unit. b2settings.h (Box2D): typedef unsigned int uint32; jsotypes.h…
CodeSalad
  • 1,375
  • 2
  • 14
  • 22
4
votes
0 answers

Javascript API to check SpiderMonkey version

Is there some API I could call from a JavaScript to check which version of SpiderMonkey it is executed on ?
TMG
  • 2,620
  • 1
  • 17
  • 40