Questions tagged [javascript-engine]

For questions related to JavaScript engine development. If you are simply referring to issues with JavaScript code, use the [javascript] tag instead.

171 questions
200
votes
6 answers

Do browsers parse javascript on every page load?

Do browsers (IE and Firefox) parse linked javascript files every time the page refreshes? They can cache the files, so I'm guessing they won't try to download them each time, but as each page is essentially separate, I expect them to tear down any…
Steve Jones
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
31
votes
5 answers

Why is new slow?

The benchmark: JsPerf The invariants: var f = function() { }; var g = function() { return this; } The tests: Below in order of expected speed new f; g.call(Object.create(Object.prototype)); new (function() { }) (function() { return this;…
Raynos
  • 166,823
  • 56
  • 351
  • 396
20
votes
7 answers

PHP Headless Browser?

Is there a headless browser library for PHP? Would like something that has a JS engine built into it. FOSS preferred.
StackOverflowNewbie
  • 39,403
  • 111
  • 277
  • 441
19
votes
1 answer

How can I see the source of built-in JavaScript functions?

E.g., alert(), Object(), String(), etc. How would I see the code behind these functions? Would I need to understand the language that an engine, such as V8, is written in and read through that, or is there a simpler solution?
jFasaJr
  • 497
  • 4
  • 17
17
votes
8 answers

Any Javascript Engine for .NET/C#?

I'm looking for an open source javascript engine for .NET. Thanks.
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
16
votes
2 answers

Nashorn alternative for Java 11

I am using the Nashorn JavaScript Engine in Java 11 which works fine except it will be deprecated soon. I have tried GraalVM which I find quite worse as it takes 13-14 seconds to execute a simple expression (e.g. 2+3). Is there any other alternative…
Sohaib Zafar
  • 183
  • 1
  • 1
  • 6
15
votes
3 answers

Javascript JSON.stringify function is not working

I have tried to convert a JS object into JSON. JSON.stringify({a:1, toJSON: function(){}}) Native JSON stringify is not working as expected. JSON stringify executes toJSON function in JS object internally. I have overwritten native code as…
HILARUDEEN S ALLAUDEEN
  • 1,722
  • 1
  • 18
  • 33
14
votes
8 answers

How to fix the Android AdMob "Unable to obtain a JavascriptEngine" error?

MainActivity class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { MobileAds.initialize(this) {} MobileAds.setRequestConfiguration( RequestConfiguration.Builder() …
H.JiMan
  • 269
  • 1
  • 2
  • 10
13
votes
1 answer

Language Engines VS. Runtimes VS. Process Virtual Machines

Since the rising popularity of JavaScript, I found it intriguing to hear (even during the same speech) either about JavaScript engine, or about JavaScript virtual machine, or JavaScript interpreter, in the same context and referring to the same…
13
votes
2 answers

How does Object.observe() affect performance?

The Object.observe() JavaScript API allows any piece of code to receive change notifications for all property changes of any JavaScript object. Doesn't this severely affect the code generation and performance optimizations that can be performed by…
usr
  • 168,620
  • 35
  • 240
  • 369
12
votes
3 answers

How can I detect which javascript engine (v8 or JSC) is used at runtime in Android?

Newer versions of Android ( > 2.2) include the v8 javascript engine, while older versions only had JSC. However, according to http://blogs.nitobi.com/joe/2011/01/14/android-your-js-engine-is-not-always-v8/, which javascript engine is used at…
digitalbath
  • 7,008
  • 2
  • 17
  • 15
11
votes
2 answers

Is JavaScript interpreted or JIT compiled?

Is JavaScript translated from source code to machine code with a JIT compiler or an interpreter? Or does it depend on the browser and the JavaScript engine you are running?
Overste
  • 111
  • 2
  • 4
9
votes
2 answers

Does IE10 use JScript 10.0

@if (@_jscript_version == 10) document.write("You are using IE10"); According to Wikipedia IE10 will use JScript 10. JScript 10 seems to have a whole bunch of new proprietary extensions to EcmaScript 5. Is the version of the EcmaScript engine…
Raynos
  • 166,823
  • 56
  • 351
  • 396
9
votes
1 answer

What JavaScript engine does Apple's Safari browser use?

I found out from the Internet that Google Chrome uses V8 and Firefox uses SpyderMonkey to compile JavaScript to machine code. What JavaScript engine does Safari browser use then?
1
2 3
11 12