T.J. Crowder wrote:
On 1 June 2012 00:28, Brendan Eich <[email protected]
<mailto:[email protected]>> wrote:
In the with example that Dave gave:
with (obj) {
foo() // no semi
.bar = 12
}
it's all allowed as in no syntax error (to correct via ASI) and no
restricted production (to make line termination significant).
Over the years people have suggested reforming 'with' a la VB by
requiring leading . before names meant to be looked up in the
'with' object instead of the scope chain. But that fails as Dave
showed.
T.J. was suggesting that Dave's cascade proposal has the 'with'
hazard, but it doesn't. No scope chain lookup. Therefore no need
for leading ., ~. or any such noise.
/be
What is "Dave's cascade proposal"? You mean throwing function calls
into the existing object extension literal? Or...?
Dave's cascade proposal:
http://blog.mozilla.org/dherman/2011/12/01/now-thats-a-nice-stache/
I'd appreciate it if characterizations like "noise" were
done...carefully. We're all here because we love JS and want to
improve it and move it forward.
No offense -- I called leading . noise too (and I've toyed with it as
somehow helping 'with' if forbidden at start of line, e.g.).
I believe it's a mistake to theory-patch, however. You were following
the reform-with path which leads to leading dot. Then the ASI (lack of
it, as usual -- "nega-ASI" :-P) problem reared its head. Then you mooted
~. This approach has a smell, in science and engineering. I say this
without meaning offense again, since I've done it myself (especially in
code, so there's a code patch too -- and technical debt if not a
user-facing "noise" spike).
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss