Re: Rest parameter anywhere

2014-04-11 Thread C. Scott Ananian
On Fri, Apr 11, 2014 at 1:53 PM, Tab Atkins Jr. wrote: > On Fri, Apr 11, 2014 at 5:39 AM, Егор Николаев wrote: >> Long story short: >> ```javascript >> function test( a = 1, b = 2, ...rest, c = 4, d = 5) { console.log(a, b, >> rest, c, d) } >> >> test();// 1, 2, [], 4, 5 >> test(9

Re: package keyword reserved?

2014-04-11 Thread Brendan Eich
Jonathan Bond-Caron wrote: Is it safe to use the 'package' keyword then, no proposals for using it? You mean for some other language compiled to JS to use 'package'? If so, then no: it's unsafe, explicitly so. The 'package' identifier is a strict future reserved word. Steer clear, the TC39 st

Re: package keyword reserved?

2014-04-11 Thread Rick Waldron
On Fri, Apr 11, 2014 at 6:23 PM, Jonathan Bond-Caron < jbo...@gdesolutions.com> wrote: > On Fri Apr 11 05:52 PM, Domenic Denicola wrote: > > What use cases does this solve for JavaScript, not TypeScript? > > > > Not sure, benefit comes down to subjective preference. Keeps the single > 'module' per

RE: package keyword reserved?

2014-04-11 Thread Jonathan Bond-Caron
On Fri Apr 11 05:52 PM, Domenic Denicola wrote: > What use cases does this solve for JavaScript, not TypeScript? > Not sure, benefit comes down to subjective preference. Keeps the single 'module' per file pattern from node.js Is it safe to use the 'package' keyword then, no proposals for using

RE: package keyword reserved?

2014-04-11 Thread Domenic Denicola
What use cases does this solve for JavaScript, not TypeScript? -Original Message- From: Jonathan Bond-Caron [mailto:jbo...@gdesolutions.com] Sent: Friday, April 11, 2014 17:44 To: Domenic Denicola; es-discuss Subject: RE: package keyword reserved? On Fri Apr 11 05:25 PM, Domenic Denicola

RE: package keyword reserved?

2014-04-11 Thread Jonathan Bond-Caron
On Fri Apr 11 05:25 PM, Domenic Denicola wrote: > > What use cases does this solve? > Struggling with Typescript's mixed module definition. a) module name {} Or b) module "name" {} Painful to make a decision about either syntax, started with (a) which isn't Ecma :/ __

Re: package keyword reserved?

2014-04-11 Thread Brendan Eich
Jonathan Bond-Caron wrote: What’s the history of the unused keyword “package”, is it from Java? In 1995, I reserved all the Java (JDK1.0 era) reserved identifiers. ES1 kept them, but ES5 cut way back, yet kept 'package' among others as reserved in strict code. No one had a championed propos

RE: package keyword reserved?

2014-04-11 Thread Domenic Denicola
What use cases does this solve? From: es-discuss [mailto:es-discuss-boun...@mozilla.org] On Behalf Of Jonathan Bond-Caron Sent: Friday, April 11, 2014 16:56 To: es-discuss Subject: package keyword reserved? What's the history of the unused keyword "package", is it from Java? Been thinking about

Re: New ES6 draft (Rev23) now available

2014-04-11 Thread Allen Wirfs-Brock
wrong styling in the source document...fixed Allen On Apr 11, 2014, at 1:37 PM, Alex Russell wrote: > 4.3.25 doesn't seem to have a title name in the HTML export. I'm assuming > some sort of Word black magic is to blame? > > > On Thu, Apr 10, 2014 at 7:13 PM, Jason Orendorff > wrote: > On S

package keyword reserved?

2014-04-11 Thread Jonathan Bond-Caron
What's the history of the unused keyword "package", is it from Java? Been thinking about this lately, could an external module be called a package? package/file.js package "something" { export class foo {} } package "other" { export class foo {} export module bar { export class foo

Re: New ES6 draft (Rev23) now available

2014-04-11 Thread Alex Russell
4.3.25 doesn't seem to have a title name in the HTML export. I'm assuming some sort of Word black magic is to blame? On Thu, Apr 10, 2014 at 7:13 PM, Jason Orendorff wrote: > On Sun, Apr 6, 2014 at 1:41 PM, Allen Wirfs-Brock > wrote: > > The April 5, 2014 ECMAScript 6 Draft Specification (Rev23

Re: Rest parameter anywhere

2014-04-11 Thread Tab Atkins Jr.
On Fri, Apr 11, 2014 at 5:39 AM, Егор Николаев wrote: > Long story short: > ```javascript > function test( a = 1, b = 2, ...rest, c = 4, d = 5) { console.log(a, b, > rest, c, d) } > > test();// 1, 2, [], 4, 5 > test(9, 8);// 9, 8, [], 4, 5 > test(9, 8, 7, 6); // 9,

Re: Clarify the destructuring syntax

2014-04-11 Thread Allen Wirfs-Brock
On Apr 11, 2014, at 10:29 AM, Егор Николаев wrote: > After firing a bug I read the spec again and realised that Get (O, P) should > already throw a Error. > So maybe I am misunderstood this from the beginning. > In this case section "12.14.5.4 4.b. If Type(v) is not Object, then throw a > TypeE

Re: Clarify the destructuring syntax

2014-04-11 Thread Егор Николаев
After firing a bug I read the spec again and realised that Get (O, P) should already throw a Error. So maybe I am misunderstood this from the beginning. In this case section "12.14.5.4 4.b. If Type(v) is not Object, then throw a TypeError exception." is useless because it already has a type checkin

Re: Clarify the destructuring syntax

2014-04-11 Thread Егор Николаев
The ticket https://bugs.ecmascript.org/show_bug.cgi?id=2639 On Fri, Apr 11, 2014 at 8:13 PM, Allen Wirfs-Brock wrote: > > On Apr 11, 2014, at 8:56 AM, Егор Николаев wrote: > > > On the one hand, the is a bug in current spec that allows the > > ```javascript > > let {length} = "qwe"; > > Where in

Re: Clarify the destructuring syntax

2014-04-11 Thread Allen Wirfs-Brock
On Apr 11, 2014, at 8:56 AM, Егор Николаев wrote: > On the one hand, the is a bug in current spec that allows the > ```javascript > let {length} = "qwe"; Where in the spec. the bug? Is a ticket filed for it? Indeed, this is supposed to be an error. Allen _

Re: New ES6 draft (Rev23) now available

2014-04-11 Thread Allen Wirfs-Brock
On Apr 10, 2014, at 9:45 PM, Michael Dyck wrote: > On 14-04-06 11:41 AM, Allen Wirfs-Brock wrote: >> The April 5, 2014 ECMAScript 6 Draft Specification (Rev23) is now >> available at >> http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#april_5_2014_draft_rev_23 > > I just notic

Re: Clarify the destructuring syntax

2014-04-11 Thread Егор Николаев
On the one hand, the is a bug in current spec that allows the ```javascript let {length} = "qwe"; ``` but disallow ```javascript let {text: {length}} = {text: "qwe"}; ``` On the other hand, this restriction can lead to hard-reproducibly errors. When I write a function such as: ```javascript functi

Re: Clarify the destructuring syntax

2014-04-11 Thread Allen Wirfs-Brock
On Apr 11, 2014, at 5:22 AM, André Bargull wrote: > On 4/11/2014 2:02 PM, Егор Николаев wrote: >> @André Bargull >> Are there any reasons for these restrictions? It confuses me. If I can >> for-of over string, so why can't I destructuring it? > > I'd say it's mostly a language designer decision

Rest parameter anywhere

2014-04-11 Thread Егор Николаев
Long story short: ```javascript function test( a = 1, b = 2, ...rest, c = 4, d = 5) { console.log(a, b, rest, c, d) } test();// 1, 2, [], 4, 5 test(9, 8);// 9, 8, [], 4, 5 test(9, 8, 7, 6); // 9, 8, [], 7, 6 test(9, 8, 7, 6, 5, 4);// 9, 8, [7, 6], 5, 4 let [a = 1,

Re: Clarify the destructuring syntax

2014-04-11 Thread André Bargull
On 4/11/2014 2:02 PM, Егор Николаев wrote: @André Bargull Are there any reasons for these restrictions? It confuses me. If I can for-of over string, so why can't I destructuring it? I'd say it's mostly a language designer decision and it may still change before the final specification is publi

Re: Clarify the destructuring syntax

2014-04-11 Thread Егор Николаев
@André Bargull Are there any reasons for these restrictions? It confuses me. If I can for-of over string, so why can't I destructuring it? On Fri, Apr 11, 2014 at 3:10 PM, André Bargull wrote: > Hi Erop, > > > On Fri, Apr 11, 2014 at 12:35 PM, Егор Николаев

Re: Clarify the destructuring syntax

2014-04-11 Thread Till Schneidereit
When in doubt, listen to André when it comes to spec details. So yes, it's valid in Firefox, but invalid per spec. Also, I agree that Firefox's behavior makes more sense, so I hope this'll change. On Fri, Apr 11, 2014 at 1:45 PM, Егор Николаев wrote: > @Till Schneidereit. Sorry, but I am misund

Re: Clarify the destructuring syntax

2014-04-11 Thread Егор Николаев
@Till Schneidereit. Sorry, but I am misunderstand you. Are you saying that this: ```javascript let {text: {length}} = {text: "123"}; ``` is valid? I am testing this behavior in traceur and FireFox. traceur says me that this is invalid spec says me that this is invalid FireFox 30.0a2 says to me tha

Re: Clarify the destructuring syntax

2014-04-11 Thread André Bargull
Hi Erop, On Fri, Apr 11, 2014 at 12:35 PM, https://mail.mozilla.org/listinfo/es-discuss>> wrote: >/ 1. Should the AssignmentExpression of DestructuringAssignment always to be />/ the Object type? />/ ```javascript />/ let {length} = "123"; />/ assert(length, 3); />/ ``` />/

Re: Clarify the destructuring syntax

2014-04-11 Thread Till Schneidereit
Hi Erop, On Fri, Apr 11, 2014 at 12:35 PM, Егор Николаев wrote: > 1. Should the AssignmentExpression of DestructuringAssignment always to be > the Object type? > ```javascript > let {length} = "123"; > assert(length, 3); > ``` > Is this valid? > Yes. > > If it is: > 2. Should the result of G

Clarify the destructuring syntax

2014-04-11 Thread Егор Николаев
1. Should the AssignmentExpression of DestructuringAssignment always to be the Object type? ```javascript let {length} = "123"; assert(length, 3); ``` Is this valid? If it is: 2. Should the result of Get(obj, name) always be the Object type if DestructuringAssignmentTarget is an ObjectLiteral or a

Re: New ES6 draft (Rev23) now available

2014-04-11 Thread Rick Waldron
On Friday, April 11, 2014, Michael Dyck wrote: > On 14-04-06 11:41 AM, Allen Wirfs-Brock wrote: > >> The April 5, 2014 ECMAScript 6 Draft Specification (Rev23) is now >> available at >> http://wiki.ecmascript.org/doku.php?id=harmony: >> specification_drafts#april_5_2014_draft_rev_23 >> > > I just