关于JavaScript中[native code]
一、总结
一句话总结:
1、[native code] 意思已经很明确了:是 native 的代码实现的 built-in 函数,而不是 JavaScript 代码
2、An implementation-dependent representation of the function is returned.
二、关于JavaScript中[native code]
转自或参考:
[native code] 意思已经很明确了:是 native 的代码实现的 built-in 函数,而不是 JavaScript 代码。
但这并不是语言标准规定的。只是恰好 Firefox、Chrome 都这么干而已。
语言标准里有说:
15.2.4.2 Function.prototype.toString()
An implementation-dependent representation of the function is returned.
它是 implementation-dependent 的。
说到 V8,可以看 v8natives.js 第 1710 行附近的 FunctionSourceString 函数:
return 'function () { [native code] }';
这就是 V8 是怎么返回 [native code] 这一串字符串的。
我的旨在学过的东西不再忘记(主要使用艾宾浩斯遗忘曲线算法及其它智能学习复习算法)的偏公益性质的完全免费的编程视频学习网站:
【读书编程笔记】fanrenyi.com;有各种前端、后端、算法、大数据、人工智能等课程。
版权申明:欢迎转载,但请注明出处
一些博文中有一些参考内容因时间久远找不到来源了没有注明,如果侵权请联系我删除。
在校每年国奖、每年专业第一,加拿大留学,先后工作于华东师范大学和香港教育大学。
2025-04-30:宅加太忙,特此在网上找女朋友,坐标上海,非诚勿扰,vx:fan404006308
录播课资料github地址:https://github.com/fry404006308/fry_course_materials
感悟总结
其它重要感悟总结
感悟总结200813
最近心境200830
最近心境201019
201218-210205
来源:https://www.cnblogs.com/Renyi-Fan/p/12683554.html |