hex13 / atom-lupa

Atom extension which displays outline for JavaScript files
MIT License
41 stars 4 forks source link

Bug in escape string processing #35

Closed onexdata closed 7 years ago

onexdata commented 8 years ago

This line:

log('\033');

will break parsing.

hex13 commented 8 years ago

is this even allowed in JS? ESLint gives me error: image.

Judging from this message there is a difference if strict mode is enabled or not: Chrome Dev Tools: console (function () { return '\033' })() (runs without errors);

(function () {"use strict"; return '\033'})() use strict enabled - there is an error: Uncaught SyntaxError: Octal literals are not allowed in strict mode.

image

So I think there are two possible things to do: