Wednesday TC39 ES3.1 notes
# Mark Miller (17 years ago)
Great capture! Minor corrections below. Each checked with Waldemar before sending.
On Wed, Jan 28, 2009 at 5:05 PM, Waldemar Horwat <waldemar at google.com> wrote:
Should bind curry over [[Construct]]?
- Agreed to use option 2 from Allen's list: bind will curry over [[Call]] and [[Construct]]. The bound closure will not have a prototype property -- [[Construct]] will use the prototype of the original function just as it normally would.
As will [[HasInstance]], which is used by instanceof.
When is eval direct? Strict?
- Agreed that eval is strict if and only if the eval'd string starts with a use directive.
That description applies to indirect eval. For direct eval, it's also strict if called from strict code.
Here are my notes on today's TC39 ES3.1 discussions. We resolved a lot of issues, which I hope I recorded all below.
John and Allen want a flag date to issue s press release about a candidate spec. Change control may be locked down after that? Waldemar: ECMA should not be the editor. Changes need to be made by a technically savvy editor. Waldemar's concern: document has been evolving too quickly, and each time he reviews the document he needs to re-read the whole thing which takes a long time. Proposed two levels of change bars after a settle-down date, with changes from ES3 -> settle-down date tracked with a different color from changes settle-down date -> head revision.
New schedule: March 1st: proposed candidate specification sometome between March and May: Candidate specification Web testing through July Wording/typo/etc. fixing through September Submitted to December GA
Need to remove ToObject from base when making references: function foo() {return this} (in strict mode) foo.call(3) -> returns a primitive (i.e. non-wrapped) 3
String.prototype.foo = foo "bar".foo() -> needs to return a primitive too
Question: what if the function does: function foo() {this.x = 5} Answer: in non-strict mode, works as before. In strict mode, throws an exception due to an attempt to set a property on a primitive.
Use a ::: instead of : grammar to describe use directive syntax in chapter 14. There are other examples of such usage in chapter 15 that can be used as a guideline. Also should describe white space using the lexar grammar, not the syntactic grammar.
[[Class]] == "String", "Date", "RegExp", "Array", "Function", ... Need [[IsArray]]? Is [[Class]] trustworthy? Should we enforce constraints on host objects of these classes? Strawman: Host objects should only be able to do what native objects can do -- doesn't work for host functions that can access data outside the ECMAScript environment. Many of the invariants are enforced by native constructors' behavior, not by constraints on native objects. Proposal:
Dealing with multiple global objects: Informative annex to 3.1? A Technical Report would be more appropriate.
Should bind curry over [[Construct]]?
Should bind result in a frozen function?
When is eval direct? Strict?
Should apply be specified like an array generic?
Should numerically named properties of strings be enumerable?
Parse time error reporting ("strict")
Regexp lookahead
Name properties of getter/setter functions defined in object literals.
Multiline comments: break/* */foo; See bugs.ecmascript.org/ticket/414
11.1.4: Replace [[Put]] of length with DefineOwnProperty. Generic array algorithms will continue to be done using [[Get]] and [[Put]] (this is important for folks who define length properties as getter-setter pairs).
JSON throws a SyntaxError when it detects a problem with the input. This is the first instance of throwing a SyntaxError based on what's typically user input data. Suggestions were made for using a FormatError or JSONError. Waldemar reluctantly relented to reach consensus to keep SyntaxError, mainly due to compatibility with existing JSON libraries. This means that users who catch SyntaxErrors hoping to catch JSON errors will catch things that are not user data errors as well if, for example, the ECMAScript program constructs faulty regular expressions or eval's code with syntax errors.
What causes the arguments object to get un-joined with local argument variables?
Dinner 6:30pm at Pezzella's.