repeated parameter names and default values

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Sep 28 10:32:54 PDT 2012


On Sep 28, 2012, at 9:16 AM, Brendan Eich wrote:

> Allen Wirfs-Brock wrote:
>> I generally use "static" to mean: solely based upon analysis of the program text without any dependencies upon runtime state. That's my criteria for classifying something as part of the language's static semantics" (which includes early errors).
> 
> Ok so far.
> 
>> All ES errors (including early errors ) end up being reported at runtime.
> 
> No, here you redefine "runtime" from any useful definition. Of course stages nest or recur fractally but in the browser, if a script loads and the first evaluation in it runs, you've reached "runtime". And ES5 is quite clear that early errors -- including in nested functions, *including in strict function*, must stop the whole script from reaching runtime.

It depends upon whether you are considering the "runtime" of an individual script or the "runtime" of an application.  Most ES applications are composed of multiple scripts  so the "early" point prior to script runtime for a particular script is still usually somewhere in the middle of the "runtime" of the application.  

> 
>>   It's only a matter of how much, if any, execution is permitted before such errors are reported.
> 
> You're still dodging the "use strict"; ES5 precedent point.

I said:

On Sep 28, 2012, at 8:46 AM, Allen Wirfs-Brock wrote:

> 
> On Sep 27, 2012, at 1:40 PM, Brendan Eich wrote:
> 
>> More, you didn't respond to my "use strict"; point. Are you going to change whether duplicate parameters with "use strict"; in the function prologue throw an early error, or not?
> 
> My default is to make no changes to existing ES5 semantics without careful consideration of the impacts. If we defer reporting of these new errors that we are discussing to a latter point during execution it might be reasonable to also defer reporting of the ES5 "use strict" derived errors.  That would presumably be a compatible change as it relaxes an error condition. But first we need to decide whether or not we are going to even have the concept of "deferred early error" .
> 
> Allen



More information about the es-discuss mailing list