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

Building SpiderMonkey with Cygwin

I need to build SpiderMonkey so that I can use it with emscripten. I succeeded in building version 1.8 (using the hack from here: http://pmelson.blogspot.fr/2007/12/building-didier-stevens-spidermonkey-in.html). But unfortunately version 1.8 lacks…
wothke
  • 130
  • 1
  • 8
0
votes
2 answers

JavaScript optimizations: how to cache local variables' initial values more efficiently?

I'm just curious. Maybe someone knows what JavaScript engines can optimize in 2013 and what they can't? Any assumptions for nearest future? I was looking for some good articles, but still there is no "bible" in the internet. Ok, let's focus on…
Dan
  • 55,715
  • 40
  • 116
  • 154
0
votes
0 answers

spidermonkey 1.8.5 this object in function

While with spidermonkey 1.7 this object was working as expected in functions, with 1.8.5 always defaults to global object. I am evaluating scripts to specific object and i expect this to be that object in functions as it did with 1.7. for…
n.amelad
  • 1
  • 1
0
votes
1 answer

How I do find properties name list of a object

JSAPI provide function JS_GetProperty to get specified property name's value but how to get them as name list / all properties name ? found similar issue on link…
Denny
  • 449
  • 4
  • 17
0
votes
4 answers

passing variables arguments to spidermonkey javascript from shell

I am running javascripts from shell using the spidermonkey javascript engine and have most things working as needed. I would like to be able to pass variables to the javascripts as arguments from the command line but have not been able to find a way…
Dave Pritlove
  • 2,601
  • 3
  • 15
  • 14
0
votes
1 answer

JS_EvaluateScript with scope chain

I saw example code on spider monkey site , JS_EvaluateScript always refer to global scope object , If I would like to create scope object which the parent is global scope , this will work ? JS_EvaluateScript (cx , scope_obj, ... ) scope_1 ----has…
Denny
  • 449
  • 4
  • 17
0
votes
1 answer

How to precompile SpiderMonkey code for faster execution?

I am using code like this: JS_EvaluateScript(context, global,"go_back('blabla')", 17, "", 1, &R); to call go_back(), which is already in the context. But this is extremely slow, and I think because the string have to be compiled each time. I try to…
exebook
  • 32,014
  • 33
  • 141
  • 226
0
votes
1 answer

What is NSString internally?

Can I assign a char* or wchar_t* to the NSString and completely avoid copying some how? I need to pass Unicode (utf16 LE) string from SpiderMonkey to UIView subclass, and my goal is to avoid copying if possible, or at least avoid intermediate…
exebook
  • 32,014
  • 33
  • 141
  • 226
0
votes
3 answers

Can javascript embedded in a C++ program faster than javascript on the web

I'm strictly a beginner with C++, but I was wondering if javascript (or Lua or any scripting language) running inside a C++ program is subject to the same kind of hardware acceleration that the C++ code can offer. I realize this would require…
expiredninja
  • 1,397
  • 4
  • 25
  • 45
0
votes
1 answer

spidermonkey 1.8.5 crashes in debug mode

I am using Spidermonkey 1.8.5 in my application. My application crashes when I use the debug JS library. I am building the library with the following options: --enable-debug --disable-optimize --enable-threadsafe crash is pointing here: Assertion…
Sandy
  • 1,043
  • 2
  • 21
  • 32
0
votes
1 answer

Fast binary data exchange between JavaScript and C/C++ with SpiderMonkey JS engine

Recently I learned that there are "External Arrays" in V8. So when you embed V8 in your app, you can map your C-array to JS-array, and even choose a type, either it's char, word, int etc. This can significantly speed up data exchange between JS and…
exebook
  • 32,014
  • 33
  • 141
  • 226
0
votes
1 answer

What does "defaults" contain?

I'm working with the Esprima parser, it outputs an AST format which is compatible with the Mozilla Spider Monkey Parser API. In the Mozilla Docs, it specifies the Function node as: interface Function <: Node { id: Identifier | null; params:…
Drahcir
  • 11,772
  • 24
  • 86
  • 128
0
votes
1 answer

python-spidermonkey object has no attribute 'eval_script' error

Using python-spidermonkey in the following way (following the guide) gives me the error AttributeError: 'spidermonkey.Context' object has not attribute 'eval_script'. >>> import spidermonkey >>> rt = spidermonkey.Runtime() >>> cx =…
Nathan Jones
  • 4,904
  • 9
  • 44
  • 70
0
votes
1 answer

Calling callback function in SpiderMonkey JS Engine

I'm using SpiderMonkey JS Engine 1.8.5 API. JS code looks like: visitChildren(function() { log("something"); }); VisitChildren is something like: JSBool visit_children(JSContext* cx, uintN argc,…
0
votes
1 answer

How to introduce window and document objects into spidermonkey javascript shell?

I'm trying to build automated script testing engine using spidermonkey. Some of the scripts I intend to test are using window and document objects, which are not defined in the js shell. Is there an easy-track way to define window and document…
Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224