3 ms·
In the case of 'break', it breaks out of the block of the current construct (loop, switch). with brings an object in scope, or calls something already in scope
by spion 9y ago
In the case of 'break', it breaks out of the block of the current construct (loop, switch). with brings an object in scope, or calls something already in scope with the object as a this argument - the semantics will be exactly opposite in this case.
Then it breaks chaining syntax (one nice thing we get), since everything will have to nest again:
x::fn()::otherFn() vs
(otherFn() with (fn() with x))
It brings more problems with ASI:
fn()
with (x); // is this fn() with (x), or fn(); with (x); do nothing