Re: Why is export default var a = 1; invalid syntax?

2015-02-18 Thread Jesse McCarthy
Jesse, you can do: `export default class Foo extends Backbone {}` Ok, thanks. The empty block is required? The part after `extends` is just an expression that evaluates to a function, right? So I could do this right (where Backbone.Model.extend() returns a function)?: export default class

Re: Why is export default var a = 1; invalid syntax?

2015-02-18 Thread Jesse McCarthy
I understand. My question is if I'm not putting anything in the block, I still have to include the empty block? Thanks, Jesse - Original Message - From: caridy car...@gmail.com To: Jesse McCarthy es-discuss-2015...@jessemccarthy.net Cc: es-discuss@mozilla.org Sent: Wednesday,

Re: Why is export default var a = 1; invalid syntax?

2015-02-18 Thread Rick Waldron
On Wed Feb 18 2015 at 4:40:34 PM Jesse McCarthy es-discuss-2015...@jessemccarthy.net wrote: Jesse, you can do: `export default class Foo extends Backbone {}` Ok, thanks. The empty block is required? Yes, just like: function Foo() {} Where the braces are the syntactic boundary around

Re: Re-export default?

2015-02-18 Thread caridy
Yes, that syntax is incorrect and confusing. There was an overside from our end to provide a way to re-export only the default export from another module, and this is something we plan to revisit for ES7/2016. Probably something like this: `export default from “foo”;` this is just sugar

Re: How would we copy an iterator?

2015-02-18 Thread Philip Polkovnikov
1. Where is the function `run`? The function `run` is pretty classic variation on the code you would see in `Q` or `bluebird`. function run(gen) { return function (/* args */) { var args = Array.prototype.slice.call(arguments); var iter = gen.apply(args); (function step(arr) {

Re: How would we copy an iterator?

2015-02-18 Thread Philip Polkovnikov
- 1. Where is the function `run`? The function `run` is pretty classic variation on the code you would see in `Q` or `bluebird`. function run(gen) { return function (/* args */) { var args = Array.prototype.slice.call(arguments); var iter = gen.apply(args); (function step(arr) {

Re: Why is export default var a = 1; invalid syntax?

2015-02-18 Thread Matthew Robb
I guess the take away here is that the default export is NOT a shared binding, correct? - Matthew Robb On Tue, Feb 17, 2015 at 5:38 PM, caridy car...@gmail.com wrote: Jesse, you can do: `export default class Foo extends Backbone {}` in case you want to reference to the exported class in

Re-export default?

2015-02-18 Thread Jason Kuhrt
I was prompted to bring this issue to es-discuss. https://github.com/babel/babel/issues/826 https://github.com/babel/babel/issues/826 It is my confusion about why this syntax does not work: export foo from ‘./foo' More details are in the issue but the gist is that sometimes it is actually

Re: Re-export default?

2015-02-18 Thread Kevin Smith
export foo from ‘./foo' I personally would find such a construct terribly confusing. But then again I find the entire default export business terribly confusing. ; ) ___ es-discuss mailing list es-discuss@mozilla.org