JSON.parse用什么编写/它是开源的吗? [英] What is JSON.parse written in / Is it open source?
问题描述
PHP函数是用C编写的,您可以根据需要查看源代码.例如这里- session_start源
PHP funcitons are written in C and you can look at the source code if you like. For example here - session_start source
Javascript呢? JSON.parse之类的函数是如何实现的?我在哪里可以查看源代码?
What about with Javascript? How are functions like JSON.parse implemented? Where can I go to view the source?
谢谢!
推荐答案
JSON.parse是本机的.这意味着它是在浏览器中定义的,该方法的实现是特定于浏览器实现的.
JSON.parse is native. That means it's defined in the browser, the implementation of the method is browser implementation specific.
v8(Chrome)具有 JsonParser::ParseJson
v8 (Chrome) has a C++ method for JsonParser::ParseJson
spidermonkey(Firefox)具有 js_json_parse
spidermonkey (Firefox) has a C++ function for js_json_parse
JavaScriptCore(Webkit/Safari)具有用于 JSONProtoFuncParse
JavaScriptCore (Webkit / Safari) has a C++ function for JSONProtoFuncParse
Rhino(Mozilla)具有Java方法,用于 parseValue
Rhino (Mozilla) has a Java method for parseValue
Opera和IE实现是封闭源代码.我还认为Nitro的实现也是封闭源代码.
the Opera and IE implementations are closed source. I also think Nitro's implementation is closed source aswell.
请注意,还有许多其他JavaScript引擎.
Note there are many other JavaScript engines.
这篇关于JSON.parse用什么编写/它是开源的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!