ECMAScript spec assertion fails when binding is deleted?

2011-03-21 Thread Jim Blandy
When executing this code: (function () { eval(var x=delete(x)) })() I think the assertion in the ECMAScript description of the declarative environment record's SetMutableBinding algorithm, 10.2.1.1.3 step 2, fails. * On entry to the function, we create a lexical environment

Re: ECMAScript spec assertion fails when binding is deleted?

2011-03-21 Thread Jim Blandy
This is a bug in the spec, and has been previously discussed here: https://mail.mozilla.org/pipermail/es5-discuss/2010-November/003839.html (Thanks, Jeff!) On 03/20/2011 11:22 PM, Jim Blandy wrote: When executing this code: (function () { eval(var x=delete(x)) })() I think

Re: Are array 'length' properties really configurable?

2010-08-26 Thread Jim Blandy
On 08/25/2010 12:30 PM, Allen Wirfs-Brock wrote: (this should probably have been posted to es5-discuss rather than es-discuss) Most of the work in 15.4.5.1 step 3 is about maintaining array length invariants that are outside the scope of the default [[DefineOwnProperty]] specification.

Are array 'length' properties really configurable?

2010-08-25 Thread Jim Blandy
Given that 15.4.5.2 makes arrays' length properties non-configurable, it seems to me that all the care taken in step three of the custom [[DefineOwnProperty]] method in 15.4.5.1 is to no avail, as the default [[DefineOwnProperty]] will refuse to make any changes anyway. I've filed a Trac

Re: Strategies for standardizing mistakes

2009-10-15 Thread Jim Blandy
On 10/14/2009 06:36 PM, Mike Shaver wrote: Our implementation of String.prototype.match checks the context in which it's called, to see if it need bother with the expense of constructing the result array (it needn't, if the match call is being used simply as a test, which isn't unheard of on

Re: Strategies for standardizing mistakes

2009-10-15 Thread Jim Blandy
On 10/15/2009 07:23 AM, Maciej Stachowiak wrote: The latter, if truly allowed by the spec, makes source-to-source transformers, even something as simple as a pretty-printer, potentially unsound. That seems like a much less bounded form of insanity. I think this point is well-taken. In

Re: Strategies for standardizing mistakes

2009-10-15 Thread Jim Blandy
On 10/15/2009 09:29 AM, Jason Orendorff wrote: I sort of doubt that everyone who touches the compiler is even aware of the constraint. /me tries to look inconspicuous ___ es-discuss mailing list es-discuss@mozilla.org

Re: Strategies for standardizing mistakes

2009-10-15 Thread Jim Blandy
On 10/15/2009 02:18 PM, Allen Wirfs-Brock wrote: Maciej's thought experiment touches upon the fundamental evil of host objects. In the presence of host objects there is no firm foundation for understanding the semantics of an ECMAScript program. Adding some additional restrictions on host

Re: Strategies for standardizing mistakes

2009-10-14 Thread Jim Blandy
On 10/13/2009 04:05 PM, Mike Shaver wrote: On Tue, Oct 13, 2009 at 7:01 PM, David-Sarah Hopwood david-sa...@jacaranda.org wrote: I agree with Maciej. The implementation-defined operations have clear specifications of their parameters. I think that it is highly undesirable to adopt an

Re: Strategies for standardizing mistakes

2009-10-14 Thread Jim Blandy
One could characterize the difference by saying that Mozilla has reluctant properties whereas WebKit has reluctant values. :) In other words, in WebKit, 'document.all' has a value --- a value that can be assigned to other variables, stored in data structures, and so on without changing its

Re: ToPropertyDescriptor and [[DefineOwnProperty]], regarding Object.defineProperty

2009-06-01 Thread Jim Blandy
Object.defineProperty lets one change the Writeable attribute with: Object.defineProperty(obj, prop, ({writeable:state})) The way that's currently defined, we just convert that one-property object to a property descriptor and pass it to [[DefineOwnProperty]]. It's a nice way to change a

Re: ToPropertyDescriptor and [[DefineOwnProperty]], regarding Object.defineProperty

2009-06-01 Thread Jim Blandy
On 06/01/2009 01:31 PM, Jeff Walden wrote: Note the footnote: I was referring to the spec type, not to an object describing a property descriptor provided by JS code. That omitted properties on such objects (even extension properties) be treated as if they were set to their default values

Nit: 11.1.1: ThisBind should be ThisBinding

2009-05-20 Thread Jim Blandy
Section 11.1.1, The this keyword, refers to the ThisBind field of the execution context; it should be ThisBinding. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

section 12.14: Note about restoration of LexicalEnvironment may be appropriate

2009-05-20 Thread Jim Blandy
Like the 'with' statement, the 'catch' clause of a 'try' statement can establish local bindings. In both cases, the spec describes this in terms of changing the execution context's LexicalEnvironment temporarily and then restoring it. In the description of 'with', there is a NOTE assuring

Nit: 10.2.2.2 refers to type by otherwise unmentioned CamelCaps name

2009-05-19 Thread Jim Blandy
In section 10.2.2.2, algorithm step 2 refers to the declarative environment record type by the StUdLyCaPs name DeclarativeEnvironmentRecord, which is never defined or used elsewhere. Perhaps it should simply be declarative environment record, as used elsewhere in the section.

Nit: 10.2.1.2.4: GetBindingValue(N,S) for object environment records

2009-05-18 Thread Jim Blandy
The last sentence of the first paragraph should end with ... the result depends on the value of the S argument:. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Nit: Appendix C: VariableDeclaration restriction lacks section number

2009-05-18 Thread Jim Blandy
In Appendix C, The Strict Mode of ECMAScript, the paragraph noting that VariableDeclaration and VariableDeclarationIn may not assign to eval in strict mode doesn't cite any particular section number; shouldn't it cite 12.2.1? ___ es-discuss mailing

Nit: Definitions of SetMutableBinding methods refer to method by wrong name

2009-05-18 Thread Jim Blandy
The definitions of the SetMutableBinding method for both declarative and object environment records (10.2.1.1.3 and 10.2.1.2.2) refer to SetMutableValue in their first sentence. This name doesn't occur anywhere else; I assume they're supposed to be SetMutableBinding.

Grammar nit: 4.2.2 The Strict Variant of ECMAScript

2009-05-14 Thread Jim Blandy
The second paragraph of 4.2.2 says: A complete ECMAScript program may be composed for both strict mode and non-strict mode ECMAScript code units. Shouldn't that say ... may be composed of both ...? ___ es-discuss mailing list es-discuss@mozilla.org