On Apr 18, 2011, at 12:32 PM, Isaac Schlueter wrote:

>> Indentation, yay. Necessary in your view, or could you just ignore 
>> everything except the separation by a line terminator?
> 
> Thinking about this a bit more, I think maybe this whole suggestion is
> a bad idea.  Forget I said anything.  Significant linebreaks are one
> thing, but significant indentation is deeply problematic.

I agree, which is why I drew the line in paren-free about JS always being a 
curly-brace language.


> Maybe the solution is a way to make return's expression non-optional?
> If you want to return nothing, then you'd `return undefined` or
> `return null`.

Drag of a migration tax but it is an early error. Will ponder further.


> In any event, I think spending a lot of effort trying to figure out
> the best way to remove ASI from the language is an unprofitable path.
> That energy would be better spent trying to figure out how best to
> remove just the problems with the current ASI implementation, and not
> throw out the baby with the bathwater.


+1, or more.

The haters are gonna hate when they really should look deeper. There is not a 
simple good vs. evil battle between using ; scrupulously or using ASI. If you 
assume ; is the one true way to terminate statements, then there's no debate at 
all.

However, given the reality of ASI, in practice there are two ways to terminate 
statements. Then the question becomes, what is more usable, optionally turning 
off ASI, or under prior opt-in to Harmony, improving ASI?

I think it's plausible that ASI can be improved, perhaps along lines you first 
suggested. E.g.,

  return
  useless expression here;

becomes an error in Harmony. Or we force return <expr>; and ban return; (but 
seems extreme to me at the moment).

/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to