link November 29 2012 Meeting Notes
John Neumann (JN), Allen Wirfs-Brock (AWB), Waldemar Horwat (WH), Brian Terlson (BT), Luke Hoban (LH), Rick Waldron (RW), Eric Ferraiuolo (EF), Doug Crockford (DC), Yehuda Katz (YK), Erik Arvidsson (EA), Mark Miller (MM), Dave Herman (DH), Sam Tobin-Hochstadt (STH), Istvan Sebastian (IS), Andreas Rossberg (ARB), Brendan Eich (BE), Alex Russel (AR), Matt Sweeney (MS)
link Approval of ECMA/TC39 Scope Declaration
(Presented by John Neumann)
JN: (presents scope document for approval)
link Conclusion/Resolution
Approved.
link Scoping for default arguments revisited
(Presented by Allen Wirfs-Brock) See Slides
AWB: (Review legacy requirements)
Two Params, Same Name allowed (non-strict)
1
2
|
|
Parameter and a Var with Same name
1
2
3
4
5
|
|
Function Declarations Override Parameter Bindings
1
2
3
4
5
|
|
link Proposal Part 1
- Simple ES<=5.1 parameter lists introduce "var bindings" in the top level scope of a function
- All ES<=5.1 rules apply
- Duplicated parameter names
- Parameter names may be same as var or function Declaration
- (missed) see slides...
ARB: These are simply the requirements.
link Proposal Part 2
- If a parameter list uses ANY parameter syntax introduced in ES6, new rules apply:
- Destructuring Parameters
- Default value initializers
- Rest Parameters
- New Rules:
- Parameter lists introduce "let bindings" in the top level scope of the function
- No duplicate param names
- Parameter names may not be the same as any other function top-level
- TDZ rules apply to parameter default value initializers
- Hoisted top-level function/var declaration are initialized after parameter initialization
- "strict" arguments object (copy of actual args, no parameter joining)
- Parameter lists introduce "let bindings" in the top level scope of the function
DH/YK/LH: This is problematic for extant offending code, that is updated to use ES6 syntax. One syntax change shouldn't have adverse effects on other, not directly related, syntax.
RW: If offending code exists, it would be smart to fix the issues, new syntax does new things.
YK: Sympathetic, but disagrees
New Rules Examples:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
|
WH/AWB/ARB: discussion about parenthesis on parameters
ARB: Points out that this is why 1JS becomes a problem where we introduce micro-modes to make things work
AWB: We need to have these to make these things work correctly
MM: Also nervous about these micro-modes, but want to see the rest of the proposal
New Rules Examples, Cont...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
|
MM, WH: I want to preserve:
- A Function, as soon as it's in scope is already initialized
- A Var variable, as soon as it's in scope is already initialized
ARB: Agree, but these things simply should not be in scope.
DH: We're making mistakes with let all around. We should wait to continue this discussion until this afternoon when all are present.
MM: Luke, where does the let research stand?
LH: Incomplete.
AWB: If there are disagreements with these rules, then someone needs to write rules that cover all these cases.
ARB: I proposed a set of rules and posted to es-discuss. Basic idea: a function with default arguments behaves as if it was a wrapper function supplying the default arguments. So initializers cannot see any definitions from the body.
link Simplest example:
1
|
|