Re: substitutes for arguments and arguments.callee in ECMAScript 5

2011-01-06 Thread Garrett Smith
On 1/5/11, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
[...]
 the function expression form has a well-defined meaning anywhere including
 in the compound statement blocks such as if-statements.  The meaning of the
 latter two declaration forms are not defined by the standard when they occur
 within compound statement blocks.  What they do, depends upon the browser.

[...]

ES5 note uses some terminology that I don't understand.

disallow usage? issue a warning? What do those mean? It'd make
sense to say throw a SyntaxError. What does it mean to issue a
warning? When does it happen? After the misplaced FD early (as early
errors)? Or do warnings cause for abrupt completion?

I'd prefer An implementation that handles FD as a Statement must
issue a warning but I think issue a warning should be defined.
-- 
Garrett
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss


Re: substitutes for arguments and arguments.callee in ECMAScript 5

2011-01-06 Thread Brendan Eich
On Jan 6, 2011, at 12:17 AM, Garrett Smith wrote:

 On 1/5/11, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
 [...]
 the function expression form has a well-defined meaning anywhere including
 in the compound statement blocks such as if-statements.  The meaning of the
 latter two declaration forms are not defined by the standard when they occur
 within compound statement blocks.  What they do, depends upon the browser.
 
 [...]
 
 ES5 note uses some terminology that I don't understand.

I missed the issue a warning there at the bottom of 12, but there's also one 
in 14.1.


 disallow usage? issue a warning? What do those mean? It'd make
 sense to say throw a SyntaxError. What does it mean to issue a
 warning? When does it happen? After the misplaced FD early (as early
 errors)? Or do warnings cause for abrupt completion?
 
 I'd prefer An implementation that handles FD as a Statement must
 issue a warning but I think issue a warning should be defined.

We are going to ban function declarations in blocks in strict mode, in Firefox 
4. We have warning facilitiies too but they can generate a ton of noise without 
extra latch logic to suppress all but the first and avoid a console-spam storm. 
We're not going to warn about functions in blocks.

A recent function-in-block case we found involved an expectation of hoisting, 
either to block top (as proposed for Harmony, where the function binding would 
be block-local) or top of enclosing function or program (as IE and followers 
do). We evangelized the site successfully to reorder things. FYI, and a hopeful 
sign.

/be

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


Re: substitutes for arguments and arguments.callee in ECMAScript 5

2011-01-06 Thread Allen Wirfs-Brock
Well, NOTES are non-normative and sometimes it is useful to be intentionally 
vague in such situations.  There is no normative use  of warning in the ES5 
specification so there is no point in formally defining it. I think the intent 
of issue a warning should be clear enough to any language implementor.  
Since, such warnings are not normative requirements, its up to the implementor 
to decide how they interpret this informative recommendation.

allen




On Jan 6, 2011, at 12:17 AM, Garrett Smith wrote:

 On 1/5/11, Allen Wirfs-Brock al...@wirfs-brock.com wrote:
 [...]
 the function expression form has a well-defined meaning anywhere including
 in the compound statement blocks such as if-statements.  The meaning of the
 latter two declaration forms are not defined by the standard when they occur
 within compound statement blocks.  What they do, depends upon the browser.
 
 [...]
 
 ES5 note uses some terminology that I don't understand.
 
 disallow usage? issue a warning? What do those mean? It'd make
 sense to say throw a SyntaxError. What does it mean to issue a
 warning? When does it happen? After the misplaced FD early (as early
 errors)? Or do warnings cause for abrupt completion?
 
 I'd prefer An implementation that handles FD as a Statement must
 issue a warning but I think issue a warning should be defined.
 -- 
 Garrett

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