Chrome中的V8本机语法 [英] V8 native syntax in Chrome

查看:81
本文介绍了Chrome中的V8本机语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Nodejs具有特殊标志-allow-natives-syntax 。是否可以将此类内容传递给Google Chrome?也许devtools提供了其他方法来访问这些信息?标志

var obj = {a:true,b:false};
console.log(%HasFastProperties(obj)); // true(快速模式)
delete obj.a;
console.log(%HasFastProperties(obj)); // false(字典模式)


解决方案

是的,您可以如果您使用-js-flags =-allow-natives-syntax 启动Chrome,则将该标志传递给Google Chrome。



(我应该指出,通常不要在启用该标志的情况下运行Chrome;仅将其用于调试您信任的网站。)


Nodejs has special flag --allow-natives-syntax. Is it possible to pass such thing to Google Chrome? Or maybe devtools provide some other way to access such information?

// running node with `--allow-natives-syntax` flag

var obj = { a: true, b: false };
console.log(%HasFastProperties(obj)); // true (Fast mode)
delete obj.a;
console.log(%HasFastProperties(obj)); // false (Dictionary mode)

解决方案

Yes, you can pass that flag to Google Chrome if you start Chrome with --js-flags="--allow-natives-syntax".

(I should point out that you should not generally run Chrome with that flag turned on; use it only for debugging of websites you trust.)

这篇关于Chrome中的V8本机语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆