How check if Google Chrome has #enable-javascript-harmony turned on

喜你入骨 提交于 2021-01-28 12:09:27

问题


I'm trying to check if the user's from Google Chrome has activate the flag #enable-javascript-harmony.

I have no idea how to do it.

Any help will be appreciate.


回答1:


Chrome flag enable-javascript-harmony turns on the V8 switch --harmony.

You can check if it is enabled by testing some ES Next functions from http://node.green (with a flag in the first column), e.g.:

const regexGreekSymbol = /\p{Script=Greek}/u;
regexGreekSymbol.test('π');

This returns true when ES Harmony is turned on and Uncaught SyntaxError: Invalid regular expression: /\p{Script=Greek}/: Invalid escape otherwise.



来源:https://stackoverflow.com/questions/34460619/how-check-if-google-chrome-has-enable-javascript-harmony-turned-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!