If it was sticky, what would you need to do to go back to sloppy?
-
-
-
There's no way to do that. You could use an eval :). Or we could add something (button or 'use sloppy'). You'd be stuck. But this is the same if you put 3 statements in the REPL vs. those 3 statements together in one REPL input.
- 2 more replies
New conversation -
-
-
I think a “mode” dropdown selection the console: Strict Sloppy Module Since module context is similar but not quite the same behaviour as strict mode
-
Cool idea. We would need to figure out what happens if you select e.g. sloppy and then write 'use strict' - does it change the dropdown permanently or only for that input? And other interactions like that.
End of conversation
New conversation -
-
-
I prefer UI toggle that controls default mode. So if the expression contains "use strict" by itself it overrides toggle for current evaluation but does not change the toggle. It looks like we finally need the spec for REPL to cover all existing problems, e.g., top-level await...
-
Eventually a spec will be the way to go, yes. We can experiment in the meantime
End of conversation
New conversation -
-
-
There could as well be a toggle in Console settings.
-
This!!! I strongly recommend a toggle
- 2 more replies
New conversation -
-
-
I'd probably just want a checkbox that I could toggle, but not sure if that is even possible. But anyway, if the behavior is "sticky" there needs to be some visual indicator whether strict mode is enabled or not.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Would prefer to start strict and stay strict. Sloppy should be seen as an ES3 compatibility mode, nothing more. Would prefer sloppy mode to become an obscure feature that most JS programmers should never even need to be aware of. It should never be the default setting.
-
DevTools REPL is for developers of any level of experience to experiment. It should reflect what people experience from regular usage of JS. Sloppy mode is the default in JS, for the better or worse.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.