This question already has an answer here:
where can I find the source code of native js functions, for example I want to look at eval()
function
In the JavaScript engine's source code.
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 is here: http://code.google.com/p/v8/
The Firefox SpiderMonkey engine is here: https://developer.mozilla.org/en/SpiderMonkey
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.
Javascript is a script language that is implemented within a Browser's code-base. This means that there may be different implementations of the script language, with different levels of quality, and possibly different intepretations of what is required. Hence the head-against-wall frustrations of many a web-developer when dealing with different web-browsers.
It is possible for you to examine a browser's implementation of Javascript if the browser is an Open Source version, eg: Chrome, Firefox, as given in other answers listed.
来源:https://stackoverflow.com/questions/10289182/where-can-i-find-javascript-native-functions-source-code