Proposal to add EventEmitter to core [ES7]

2015-05-31 Thread aakarsh1997
Hi, I propose the inclusion of the node/io EventEmitter class[1] in core targeting ES7. Reasoning: The .on/.emit model is very popular[2] in the ECMAScript land, and it suits the language a lot. We use events pretty much everywhere in the JS land. It makes sense for the standard EventEmitter

import ModuleSpecifier

2015-05-31 Thread Mark Volkmann
I was under the impression that the following is a valid import statement: import {something} from './somefile'; I know this used to work in Traceur. However, in the latest version of Traceur I have to include a file extension like this for it to work: import {something} from './somefile.js';

Re: Maybe we need a reflect API to iterate over instance members

2015-05-31 Thread Gray Zhang
Not exactly Reflect.ownKeys does not walk up prototype chain so it does not return inherited members Reflect.enumerate seems not return non-enumerable members What I propose is an API that returns both non-enumerable and inherited members Best regards Gray Zhang 在 2015年6月1日 上午1:15:58,

Re: Maybe we need a reflect API to iterate over instance members

2015-05-31 Thread Jordan Harband
Would `Reflect.ownKeys` or `Reflect.enumerate` help you here? On Sun, May 31, 2015 at 4:42 AM, Gray Zhang otakus...@icloud.com wrote: Since class’s members are non-enumerable by default (which is a good choice) we cannot use for .. in to iterate over all members of an instance, the same

Re: 2 questions about ES6 module loaders

2015-05-31 Thread Brendan Eich
Glen wrote: PS. from X import Y syntax would have been useful in cases where IDEs provide auto-completion. I know it's too late for changes now. It has other advantages: Python-like for those who care; Y can be a long braced list or pattern, which goes better at the end. But too late, and

RE: import ModuleSpecifier

2015-05-31 Thread Domenic Denicola
It is syntactically valid, but there is no specification for what the module specifier string should contain. Traceur has one rule, and if you’re using Traceur you need to follow Traceur’s rules. I’m sure other transpilers have their own chosen rules. In a hypothetical future where browsers

Re: import ModuleSpecifier

2015-05-31 Thread Brendan Eich
Browsers in any semi-competitive market will agree on a standard. I don't see why that needs to be called into doubt, even as part of a hypothetical future :-|. (Is there another kind? :-P) /be Domenic Denicola wrote: Yes, in theory. However, browsers are more likely to wait until there’s a

Re: import ModuleSpecifier

2015-05-31 Thread Mark Volkmann
Are you saying that in the future each browser can have its own rule for module specifier strings? On Sun, May 31, 2015 at 4:31 PM, Domenic Denicola d...@domenic.me wrote: It is syntactically valid, but there is no specification for what the module specifier string should contain. Traceur has

RE: import ModuleSpecifier

2015-05-31 Thread Domenic Denicola
Yes, in theory. However, browsers are more likely to wait until there’s a standard for browser module loaders before shipping modules, in order to avoid such divergent behavior. But, I doubt that io.js, Traceur, etc. will follow the browser-loader standard. For example io.js will likely have a

Re: Maybe we need a reflect API to iterate over instance members

2015-05-31 Thread Steve Fink
Forgive me for golfing it, but function getAllPropertyNames(o) { if (!o) return []; return Object.getOwnPropertyNames(o) + getAllPropertyNames(Object.getPrototypeOf(o)); } or as a generator function* allPropertyNames(o) { if (!o) return; yield* Object.getOwnPropertyNames(o);

Re: 2 questions about ES6 module loaders

2015-05-31 Thread Glen
What's the reason for this? With something like PJAX, you would look for a header in order to disable the layout. I thought maybe if you loaded a JS module and it imported a view, that view could share the same endpoint as the one used to render the whole page. It's not a big deal though, I

Maybe we need a reflect API to iterate over instance members

2015-05-31 Thread Gray Zhang
Since class’s members are non-enumerable by default (which is a good choice) we cannot use for .. in to iterate over all members of an instance, the same problem could exists in a plain object when we use Object.defineProperty API. In real world there are some scenarios where we need to iterate