"use strict" converted to hexa breaks strict mode
See original GitHub issueMaybe an “exclude” option could be useful for string to hexa. Additionally, strings are always converted to hexadecimal code. Since it’s not difficult to decrypt hexa, could you please make this optional ?
function is_strict(){
'use strict'; // <------- broken
var is_strict = false;
try {
mistypeVariable = 17; // throws a ReferenceError in strict mode
} catch(e) {
is_strict = true;
}
return is_strict;
}
alert('strict mode = '+is_strict());
//function is_strict() {
// '\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74';
// var _0x2d65e3 = ![];
// try {
// mistypeVariable = 0x11;
// } catch (_0x457d9d) {
// _0x2d65e3 = !![];
// }
// return _0x2d65e3;
//}
//alert('\x73\x74\x72\x69\x63\x74\x20\x6d\x6f\x64\x65\x20\x3d\x20' + is_strict());
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Strict mode - JavaScript - MDN Web Docs
JavaScript's strict mode is a way to opt in to a restricted variant of JavaScript, thereby implicitly opting-out of "sloppy mode".
Read more >Changed octals to hex for ES6 strict mode #2866 - GitHub
I think this issue and #2835 cover the same problem – is anyone else seeing ES6-style stuff (e.g. babel) break without this?
Read more >Why are Octal numeric literals not allowed in strict mode (and ...
Octal literals are not allowed because disallowing them discourages programmers from using leading zeros as padding in a script.
Read more >JavaScript Strict Mode
Nothing. The “use strict” directive is simply a string statement that will be ignored by JavaScript engines that don't support Strict Mode. This ......
Read more >JavaScript: Convert ASCII to Hexadecimal format - w3resource
DEC OCT HEX BIN Symbol HTML Number Description
0 000 00 00000000 NUL � Null char
1 001 01 00000001 SOH  Start of Heading
2...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you very much, it’s perfect
Nice. Please close the issue if your problem was solved.