Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find javascript native functions source code? [duplicate]

where can I find the source code of native js functions, for example I want to look at eval() function

like image 715
ASD Avatar asked Apr 23 '12 22:04

ASD


People also ask

Where can I see JavaScript source code?

For most browsers, to view inline JavaScript in the HTML source code, do one of the following. Press the Ctrl + U keyboard shortcut. Right-click an empty area on the web page and select the View page source or similar option in the pop-up menu.

What is JavaScript native code?

Native code is computer programming (code) that is compiled to run with a particular processor (such as an Intel x86-class processor) and its set of instructions. If the same program is run on a computer with a different processor, software can be provided so that the computer emulates the original processor.


2 Answers

Both Chrome and Firefox are open source and you can look at the implementation of any part of the javascript engine in the source code for those products. Other browsers have their own implementation (like IE) that is not available to the public to look at.

The Chrome v8 javascript engine code is here: https://github.com/v8/v8

The Firefox SpiderMonkey engine code is here: https://searchfox.org/mozilla-central/source/js/src

Warning, if you aren't already familiar with those products and their tools, it may take while to get familiar enough to find what you're looking for.

These links may change over time, but can easily be found with Google searches if they move.

like image 72
jfriend00 Avatar answered Oct 20 '22 00:10

jfriend00


In the JavaScript engine's source code.

like image 39
rid Avatar answered Oct 19 '22 23:10

rid