问题
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