简体   繁体   English

Chrome中的V8本机语法

[英]V8 native syntax in Chrome

Nodejs has special flag --allow-natives-syntax . Nodejs具有特殊标志--allow-natives-syntax Is it possible to pass such thing to Google Chrome? 是否可以将此类内容传递给Google Chrome? Or maybe devtools provide some other way to access such information? 也许devtools提供了其他一些访问此类信息的方式?

// 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" . 是的,如果您使用--js-flags="--allow-natives-syntax"启动Chrome,则可以将该标志传递给Google Chrome。

(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;仅将其用于调试您信任的网站。)

No. You can find all available Chrome command line flags here: https://peter.sh/experiments/chromium-command-line-switches/ 否。您可以在此处找到所有可用的Chrome命令行标志: https : //peter.sh/experiments/chromium-command-line-switches/

You might be able to do a custom Chromium build that passes along that flag. 您可能能够执行自定义的Chromium构建,并传递该标志。 You could also hook into the Chrome process and set the value of the symbol manually. 您也可以加入Chrome进程并手动设置符号的值。 Both options suck. 两种选择都很糟糕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM