A Precedent

2013-04-12 Thread Andrea Giammarchi
a principle or rule established in a previous case: http://en.wikipedia.org/wiki/Precedent I should not be here and I will not answer, just my last attempt trying to make a point. Please consider the main developer behind node.js agrees this property should never land in JS as it's a minefield

Re: A Precedent

2013-04-12 Thread Andrea Giammarchi
due not so new, and not so old, Android devices, Nokia, etc. All the best On Fri, Apr 12, 2013 at 2:54 AM, Alex Russell slightly...@google.comwrote: Hey Andrea, Response inline. On Fri, Apr 12, 2013 at 9:01 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: a principle or rule

Re: A Precedent

2013-04-12 Thread Andrea Giammarchi
Adding Object.setPrototypeOf does not help, because code won't migrate to it completely so we'll be stuck with two APIs. As shown in the first post we'll be stuck with 4 APIs plus the 5th one standardized. The __proto__ that is not supported, the one that is wrongly inherited in

Re: A Precedent

2013-04-12 Thread Andrea Giammarchi
decide to drop __proto__ and without an alternative the server could miss a handy opportunity, for whoever needs it, to promote inheritance in existent objects. On Fri, Apr 12, 2013 at 4:05 PM, Brendan Eich bren...@mozilla.com wrote: Andrea Giammarchi wrote: Adding Object.setPrototypeOf

Re: A Precedent

2013-04-12 Thread Andrea Giammarchi
he doesn't need to fork V8, he simply needs to delete Object.prototype.__proto__; at startup time so I am getting real On Fri, Apr 12, 2013 at 6:21 PM, Brendan Eich bren...@mozilla.com wrote: Andrea Giammarchi wrote: if you consider Object.setPrototypeOf an API and __proto__ another one

Re: A Precedent

2013-04-12 Thread Andrea Giammarchi
! On Fri, Apr 12, 2013 at 6:27 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: he doesn't need to fork V8, he simply needs to delete Object.prototype.__proto__; at startup time so I am getting real On Fri, Apr 12, 2013 at 6:21 PM, Brendan Eich bren...@mozilla.com wrote: Andrea

on caller descriptor

2013-04-14 Thread Andrea Giammarchi
I wonder if all of this is expected: (function(){ use strict; function caller() { alert(caller.caller); } // error if invoked: caller(); // but showing up in properties var properties = Object.getOwnPropertyNames(caller); if (properties.indexOf('caller')) {

Object.mixin() reacher proposal

2013-04-14 Thread Andrea Giammarchi
what I've written here: https://github.com/WebReflection/object-mixin/blob/master/src/object-mixin.js is a better proposal for the potential `Object.mixin()` in current ES6 specs. It seems that Mixins Are Awesome and this can take most advantages from being a function and not only an object:

Re: Object.mixin() reacher proposal

2013-04-14 Thread Andrea Giammarchi
apologies getOwnPropertyDescriptor( source, key ) should have been getOwnPropertyDescriptor( enricher, key ) On Sun, Apr 14, 2013 at 1:58 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: what I've written here: https://github.com/WebReflection/object-mixin/blob

Re: Object.mixin() reacher proposal

2013-04-14 Thread Andrea Giammarchi
also, in case you are guessing the typo .. reacher because it could reach more (older) engines, doing a joke with richer got it? .. too damn fun, I know! On Sun, Apr 14, 2013 at 2:04 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: apologies getOwnPropertyDescriptor( source

Re: on caller descriptor

2013-04-14 Thread Andrea Giammarchi
generalizing means that for any generic object we should try/catch to avoid that error ? talking about automated code ... the whitelist is everyday bigger :) Thanks for the answer On Sun, Apr 14, 2013 at 8:07 AM, Rick Waldron waldron.r...@gmail.comwrote: On Sunday, April 14, 2013, Andrea

Re: Object.mixin() reacher proposal

2013-04-14 Thread Andrea Giammarchi
Object.mixin should be able to accept a function and invoke it with target as context with optional arguments would be really a **great idea**, IMHO Thanks On Sun, Apr 14, 2013 at 2:45 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: also, in case you are guessing the typo

Re: Object.mixin() reacher proposal

2013-04-14 Thread Andrea Giammarchi
right, I've simplified a lot and tested cross platform: https://github.com/WebReflection/object-mixin#object-mixin thoughts? On Sun, Apr 14, 2013 at 10:07 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: OK, maybe just code was a non-sense ... So, the idea behind is mark

Re: Object.mixin() reacher proposal

2013-04-14 Thread Andrea Giammarchi
, Thing); Object.mixin(Thung.prototype, Thang); On Sun, Apr 14, 2013 at 12:59 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: right, I've simplified a lot and tested cross platform: https://github.com/WebReflection/object-mixin#object-mixin thoughts? On Sun, Apr 14, 2013 at 10:07

Re: Object.mixin() reacher proposal

2013-04-14 Thread Andrea Giammarchi
wrote: yeah that's better - I was having a senior moment - most constructor functions will normally reside in the prototype of course On Sun, Apr 14, 2013 at 1:59 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: My previous version was doing that in a probably too smart way so I've

Re: A Precedent

2013-04-14 Thread Andrea Giammarchi
at least in Firefox is working like that: var blackMagic = Object.getOwnPropertyDescriptor( Object.prototype, '__proto__' ).set; var NaO = Object.create(null); var o = {}; blackMagic.call(NaO, o); o.isPrototypeOf(NaO); // true if this will work cross browser like this adopting a method

Re: Object.mixin() reacher proposal

2013-04-14 Thread Andrea Giammarchi
libraries, that tried to be smarter than what the languages core already provides except the last one that just sticks to a module library. On Sun, Apr 14, 2013 at 11:48 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: somebody already raised the concern what if I want to mixin

Re: Object.mixin() reacher proposal

2013-04-14 Thread Andrea Giammarchi
-mixin/test/ Best Regards On Sun, Apr 14, 2013 at 10:23 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: not sure changing name is a thing to promote, it makes method name clashing easier but it can be achieved simply attaching properties to a specific object and then pass

Re: First crack at a Streams proposal

2013-04-15 Thread Andrea Giammarchi
It's a nice effort but I agree with Nuno that fragmentation even on these things already in production (despite the versioning) out there and already working practically for the real-world isn't any good for the next future of the JS community. Also, JS has been kept general purpose enough, I

Re: First crack at a Streams proposal

2013-04-15 Thread Andrea Giammarchi
. jackalm...@gmail.comwrote: On Mon, Apr 15, 2013 at 1:51 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: It's a nice effort but I agree with Nuno that fragmentation even on these things already in production (despite the versioning) out there and already working practically for the real

Re: First crack at a Streams proposal

2013-04-15 Thread Andrea Giammarchi
of course, that is just my opinion. I am looking forward to read others ... meanwhile, in texas JS, a talk about node streams: http://2013.texasjavascript.com/stream/ Regards On Mon, Apr 15, 2013 at 2:12 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I've implemented Alex Future

Re: First crack at a Streams proposal

2013-04-15 Thread Andrea Giammarchi
well, if the purpose is different and you need to describe streams as observables or signals then I would suggest to change naming convention so nobody will ever be confused again. On Mon, Apr 15, 2013 at 2:36 PM, Domenic Denicola dome...@domenicdenicola.com wrote: I think a large part of

Re: First crack at a Streams proposal

2013-04-15 Thread Andrea Giammarchi
On Mon, Apr 15, 2013 at 2:04 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: Also, JS has been kept general purpose enough, I would not try to influence the language too much after DOM and W3C APIs and I thought this was also same idea of TC39. I don't understand this sentence. It

Re: First crack at a Streams proposal

2013-04-15 Thread Andrea Giammarchi
how about .pull() then, to read, and .push() to write :D On Mon, Apr 15, 2013 at 5:34 PM, Jake Verbaten rayn...@gmail.com wrote: So one thing that is confusing is that `next()` has an API that looks like the stream is a pull stream. A pull stream means that you call next() and it will give

Re: DOM EventStreams (take two on Streams): Request for feedback

2013-04-16 Thread Andrea Giammarchi
why is that? void forEach(mapCB); if that's to make it consistent with Array#forEach you should accept the context argument in both map and forEach too? However, I don't get why this should not work: str.forEach(callback).then(notify); Said that, I think is quite good after some renaming,

Re: DOM EventStreams (take two on Streams): Request for feedback

2013-04-16 Thread Andrea Giammarchi
yep, I was wrapping there already ... ain't needed. Looking forward to see some example and read others opinion. all the best On Tue, Apr 16, 2013 at 5:20 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: On Tue, Apr 16, 2013 at 5:12 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote

Re: B.3.1 The __proto__ pseudo property

2013-04-20 Thread Andrea Giammarchi
+1 to everything, but I would drop the literal too instead of promoting two ways to do things. off topic: I also hope __proto__ will be spec'd with a descriptor that exposes the setter as it is now in Firefox, and not only the getter, as conceptual language nonsense/restriction. On Sat, Apr 20,

Re: ES6,ES7,ES8 and beyond. A Proposed Roadmap.

2013-04-21 Thread Andrea Giammarchi
not sure I understand those examples, but the moment a developer starts yelding everything, is the moment all non-blovking asynchronous advantages are gone 'cause you are waiting instead of keep doing the rest, isn't it? On Sat, Apr 20, 2013 at 9:56 PM, Domenic Denicola

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
you can hot-swap the chain, something Object.create() cannot do so it is much more powerful, unless things changed that much lately ... On Sun, Apr 21, 2013 at 11:03 AM, David Herman dher...@mozilla.com wrote: On Apr 21, 2013, at 8:55 AM, Allen Wirfs-Brock al...@wirfs-brock.com wrote:

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
V8 already poisons when getOwnPropertyDescriptor has a setter and this setters is the __proto__ one: https://code.google.com/p/v8/source/browse/trunk/src/v8natives.js#390 This means V8 always throws and does not preserve the same realm, if I understand what that means:

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
Allen that's correct/expected ... as __proto__ is own in the Object.prototype only or am I missing something? On Sun, Apr 21, 2013 at 12:21 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Apr 21, 2013, at 11:53 AM, Brendan Eich wrote: Allen Wirfs-Brock wrote: ... This is specified

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
for how much I love being ignored, I agree on Brendan, once deleted, which is an explicit action that means get this stuff out of my environment nothing else should be affected. If people would like to create enumerable/configurable/writable properties at runtime together with specific

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
then you'll have ambiguous operations obj[key] = value; will not always do the same since obj[key] will not always do the same neither. If a program decides/needs/wants no magic then magic should disappear and if not in the chain it should not be inherited. I'd rather leave, if really

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
as you want. Not true the other way round On Sun, Apr 21, 2013 at 1:09 PM, Brendan Eich bren...@mozilla.com wrote: Andrea Giammarchi wrote: for how much I love being ignored, Not rehashing != ignoring. I agree on Brendan, once deleted, which is an explicit action that means get this stuff

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
love it ... reminds me those days when [] or {} were invoking Array and Object in some env ... Anyway, I believe Allen is trying to say that {__proto__:whatever} should be spec'd as syntax, regardless what will be of the Object.prototype.__proto__ property/descriptor so that you can get rid of it

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
agreed for consistency too, once deleted, the magic should disappear 100% reality will be that most devs won't delete it so I don't see concrete side effects out there. However, this is how I would spec it (or better, how I would drop the axe accepting a compromise for this property)

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
property === '__proto__' can be true only with Object.prototype) well, I am sure you all got the point about the possibility of replicating or being completely free from this property On Sun, Apr 21, 2013 at 2:11 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: agreed

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
Off Topic: it's really funny that it took 10 years to teach people how inheritance works in JS and today there's some legacy that instead of constructors uses their objects or just objects as prototype so that {__proto__:whatever} is considered a used pattern. If the most common case is

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
that won't work? __proto__ in {__proto__:{}}; // true __proto__ in {__proto__:{}}; // still true, since __proto__ in Object.prototype, unless deleted am I wrong? On Sun, Apr 21, 2013 at 3:27 PM, Mark S. Miller erig...@google.com wrote: Warning: The following is a sickening idea. I would

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
:33 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: that won't work? __proto__ in {__proto__:{}}; // true __proto__ in {__proto__:{}}; // still true, since __proto__ in Object.prototype, unless deleted am I wrong? On Sun, Apr 21, 2013 at 3:27 PM, Mark S. Miller erig

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
overwritten ... yak?! On Sun, Apr 21, 2013 at 3:33 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: that won't work? __proto__ in {__proto__:{}}; // true __proto__ in {__proto__:{}}; // still true, since __proto__ in Object.prototype, unless deleted am I wrong? On Sun, Apr

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
On Sun, Apr 21, 2013 at 6:11 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: We are free to specify a semantics that will make sense, now and for the long term. then, for the long term, if all I understood about this thing is that stinks for everybody, you should really consider to give

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
, 2013 at 6:47 PM, Andrea Giammarchi andrea.giammar...@gmail.com mailto:andrea.giammarchi@**gmail.comandrea.giammar...@gmail.com wrote: On Sun, Apr 21, 2013 at 6:11 PM, Allen Wirfs-Brock al...@wirfs-brock.com mailto:al...@wirfs-brock.com** wrote: We are free to specify

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
even agree that, when we're uncertain, we should err on the side of cleaning things up. Until IE changed expectation, we were doing exactly that by avoiding __proto__. Today, we no longer have that happy uncertainty. On Sun, Apr 21, 2013 at 6:47 PM, Andrea Giammarchi andrea.giammar

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
. Is this any more clear? Thanks for your patience, it's clearly hard for me to express myself in your own terms. Regards On Sun, Apr 21, 2013 at 9:59 PM, Mark S. Miller erig...@google.com wrote: On Sun, Apr 21, 2013 at 9:56 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote

Re: B.3.1 The __proto__ pseudo property

2013-04-21 Thread Andrea Giammarchi
oh dear ... var protoSetter = Object.getOwnPropertyDescriptor( Object.prototype, '__proto__' ).set; // forgot the setter in previous example On Sun, Apr 21, 2013 at 10:07 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: right now this is the V8 situation: https

Re: B.3.1 The __proto__ pseudo property

2013-04-22 Thread Andrea Giammarchi
then what's the point to poison Object.getOwnPropertyDescriptor(Object.prototype, __proto__).set if anyone can always use __proto__ to change the chain ? I don't understand this poisoning ... I don't see any advantage, only problems if some library would like to drop __proto__ and use in edge

Re: B.3.1 The __proto__ pseudo property

2013-04-23 Thread Andrea Giammarchi
discussion oriented to SES again, I hope this won't be spec'd blindly after some SES requirement that might be very different from, let's say, node.js requirements, where the concept of security is not about evaluating runtime unknonw code ... right? :-) I keep being amazed by how many problems

Re: ES6 __proto__ test suite

2013-04-23 Thread Andrea Giammarchi
test driven specs development ... I like that. Everything seems to be OK except one test is missing which is the key for me, the (hopefully not) poisoned setter On Tue, Apr 23, 2013 at 10:34 AM, David Bruant bruan...@gmail.com wrote: Hi, Based on recent messages on es-discuss, I feel that

Re: B.3.1 The __proto__ pseudo property

2013-04-23 Thread Andrea Giammarchi
at 10:23 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: discussion oriented to SES again, I hope this won't be spec'd blindly after some SES requirement that might be very different from, let's say, node.js requirements, where the concept of security is not about evaluating runtime

Re: B.3.1 The __proto__ pseudo property

2013-04-23 Thread Andrea Giammarchi
then is more Ha, ha, ha. Lulz, I told you, lulz! this one? '__proto__' in {__proto__:null,__proto__:null} On Tue, Apr 23, 2013 at 5:34 PM, Jeff Walden jwalden...@mit.edu wrote: On 04/21/2013 03:27 PM, Mark S. Miller wrote: Warning: The following is a sickening idea. I would really hate to

Re: __defineGetter__ returns

2013-05-07 Thread Andrea Giammarchi
Do you believe acting passively will keep bringing any good to the language specification? A **precedent**, title of one of my posts about __proto__, is exactly what you have here. Since every browser has it, no matter how bad or good it is, let's us put that there too and it will be standard

Re: __defineGetter__ returns

2013-05-07 Thread Andrea Giammarchi
the past? This is a concern of mine, and I'd like to hear a clear statement about this, thanks. On Tue, May 7, 2013 at 10:24 AM, Mark S. Miller erig...@google.com wrote: On Tue, May 7, 2013 at 10:15 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: Do you believe acting passively

Re: B.3.1 The __proto__ pseudo property

2013-05-07 Thread Andrea Giammarchi
fine for non-extensible objects, you might desire to keep a dictionary a dictionary though, allowing properties extensions avoiding hot-swap inheritance 2 options in my mind: 1. Object.freezeInheritance(generic), setting a [[MutablePrototype]] internal property to false (true by default) 2.

Re: B.3.1 The __proto__ pseudo property

2013-05-08 Thread Andrea Giammarchi
I proposed a flag for a reusable setter they told me they have no interest to fragment the language behind these kind of flags ... To all: a new syntax is also more suitable for shims/polyfills, something broken/partial implementation of __proto__.set descriptor cannot replace so, as direction,

Re: for-in, shadowing and deleting properties.

2013-05-08 Thread Andrea Giammarchi
in the Example 1 you simply loop over all keys in the chain, included the x inherited from b. The fact you shadow that is irrelevant, it was there in any case. The fact you get 1 in the log is because you access the shadowed property through a[i] so expected result. You are doing a for/in, not a

Re: B.3.1 The __proto__ pseudo property

2013-05-08 Thread Andrea Giammarchi
it took 8 years to teach JS developers **not** to pollute Object.prototype, I understand your concern and I understand with the possibility to drop enumerability that could (and will) be proposed by someone. At the same time it will be a stubborn move aim to fix some deprecated, old, not

Re: B.3.1 The __proto__ pseudo property

2013-05-09 Thread Andrea Giammarchi
I would rather bury __proto__ sooner through a --no-black-magic-in-object-prototype V8 flag but again, I proposed a flag and V8 said they don't want to go for this direction ... **actually it was you saying that** https://code.google.com/p/v8/issues/detail?id=2645#c3 We have no interest in

Re: Traits/Mixins for class syntax

2013-05-17 Thread Andrea Giammarchi
for what it matters, redefine.js already does exactly that. ( https://github.com/WebReflection/redefine#classes ) var Foo = redefine.Class({ extend: Bar, mixin: [F, object, F2.prototype, Class3] }); and yes, it makes perfect sense, specially for mixins such EventEmitter and similar my 2

On ECMA International

2013-05-17 Thread Andrea Giammarchi
I've tried to find something like ECMA constitution or how things work here page in what I think is the official ECMA website: http://www.ecma-international.org/ I could not find what I am looking for, which is an answer to this question: Does TC39 make decisions based on majority or unanimity?

Re: On ECMA International

2013-05-17 Thread Andrea Giammarchi
Eich bren...@mozilla.com wrote: Andrea Giammarchi wrote: I've tried to find something like ECMA constitution or how things work here page in what I think is the official ECMA website: http://www.ecma-international.**org/ http://www.ecma-international.org/ I could not find what I am looking

Re: On ECMA International

2013-05-17 Thread Andrea Giammarchi
This seems more than reasonable so, for what I understand, is majority as long as there's no **concrete** harm/problem/worst damage doing that way that could make someone really disappointed. Aka: consensus On Fri, May 17, 2013 at 3:55 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: When it

Re: B.3.1 The __proto__ pseudo property

2013-05-20 Thread Andrea Giammarchi
does `Proxy` trap `Object.getPrototypeOf` somehow ? If yes, why do you think having two namespaces for the prototype operation is better? If not, why do you think that is not needed in case of getting the prototype? In any case, how `Object.setPrototypeOf` differs anyhow compared to how the

Re: B.3.1 The __proto__ pseudo property

2013-05-20 Thread Andrea Giammarchi
I believe having a counterpart in the Object, following a natural expectation where for a get you've got a set, is just fine but surely Reflect should have its own reflection power a part. I see Reflect more like an introspection tool able to understand things and not necessarily mutate them (

Re: B.3.1 The __proto__ pseudo property

2013-05-20 Thread Andrea Giammarchi
...@mozilla.comwrote: On 5/20/2013 10:55 AM, Andrea Giammarchi wrote: I believe having a counterpart in the Object, following a natural expectation where for a get you've got a set, is just fine but surely Reflect should have its own reflection power a part. I see Reflect more like an introspection tool

Re: B.3.1 The __proto__ pseudo property

2013-05-20 Thread Andrea Giammarchi
behavior with null objects and not null objects) Thanks and Best Regards On Mon, May 20, 2013 at 2:55 PM, Brendan Eich bren...@mozilla.com wrote: Andrea Giammarchi wrote: that's fine with what I am thinking/saying ... it's used as reflection, to intercept, or to trap, and not used to do

Re: B.3.1 The __proto__ pseudo property

2013-05-21 Thread Andrea Giammarchi
On Tue, May 21, 2013 at 12:56 AM, Brendan Eich bren...@mozilla.com wrote: Andrea Giammarchi wrote: can I also suggest to analyze, if there's still any doubt left on a method VS a property yet, this piece of code if not highlighted before? I do not understand what you mean here. I mean

Re: B.3.1 The __proto__ pseudo property

2013-05-21 Thread Andrea Giammarchi
for always work I meant as long as the object is not sealed/frozen as discussed a while ago On Tue, May 21, 2013 at 9:43 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: On Tue, May 21, 2013 at 12:56 AM, Brendan Eich bren...@mozilla.comwrote: Andrea Giammarchi wrote: can I also

Re: B.3.1 The __proto__ pseudo property

2013-05-21 Thread Andrea Giammarchi
Giammarchi wrote: On Tue, May 21, 2013 at 12:56 AM, Brendan Eich bren...@mozilla.comwrote: Andrea Giammarchi wrote: can I also suggest to analyze, if there's still any doubt left on a method VS a property yet, this piece of code if not highlighted before? I do not understand what you mean

Re: Overriding Map/etc with get/set hooks?

2013-05-22 Thread Andrea Giammarchi
is simply static collection, so immutable: ``` var all = document.querySelectorAll(*); var length = all.length; all[length] = 'whatever'; alert(all.length === length); [].push.call(all, 'whatever'); alert(all.length === length); ``` you can put properties because is extensible but you won't

Re: Overriding Map/etc with get/set hooks?

2013-05-22 Thread Andrea Giammarchi
I believe Tab is asking for something like: `var MyNodeList = new ArrayType(EntryType, length);` where `EntryType` is his own type and the result is an array like collection or map. At least, for what I understood, looks like he's asking for JS CTypes, something rumored a while ago but never

Re: Overriding Map/etc with get/set hooks?

2013-05-22 Thread Andrea Giammarchi
you wrote: What do I need to do to get a Map like that? I answered but I've mistaken your original question and apologized already. regards On Wed, May 22, 2013 at 11:10 AM, Tab Atkins Jr. jackalm...@gmail.comwrote: On Wed, May 22, 2013 at 11:00 AM, Andrea Giammarchi andrea.giammar

Re: Object.mixin/Object.assing with multiple args

2013-05-22 Thread Andrea Giammarchi
I think `[mixin1, mixin2, mixin3].reduce(Object.mixin, source);` is a win, only thing I am not sure, is how this third argument could make into this approach (if reusable, I didn't even know about this extra arg) Any hint on the extra arg appreciated for polyfill purpose, thanks On Wed, May 22,

Re: Object.mixin/Object.assing with multiple args

2013-05-22 Thread Andrea Giammarchi
to apply. Dmitry On Wed, May 22, 2013 at 6:13 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I think `[mixin1, mixin2, mixin3].reduce(Object.mixin, source);` is a win, only thing I am not sure, is how this third argument could make into this approach (if reusable, I didn't even know

Re: Object.mixin/Object.assing with multiple args

2013-05-22 Thread Andrea Giammarchi
TC39 won't lie = TC39 won't like On Wed, May 22, 2013 at 6:22 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I never hold on on polyfills, I already use Object.mixin in redefine.js and other personal code ;-) I think the direction is that second argument to N extra is an old

Re: Object.mixin/Object.assing with multiple args

2013-05-22 Thread Andrea Giammarchi
Sorry but `class B extends Object.mixing(Mixin1, Mixin2, Mixin3...)` does not make sense to me ... would you mind explaining that ? I am curious about this need to have more args there since nowadays there are many ways to simulate that and `String.fromCharCode`, as example, demonstrated

Re: Object.mixin/Object.assing with multiple args

2013-05-23 Thread Andrea Giammarchi
for us. Currently these exact two methods are not a hi-pri, I believe there are more important things to discuss, but still those two would be great to reconsider. Dmitry On Wed, May 22, 2013 at 8:35 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: Sorry but `class B extends

Re: Module syntax

2013-06-03 Thread Andrea Giammarchi
+1 as soon as the syntax is slightly different from NPM/AMD makes sense to have less ambiguity and a better definition. export default looks good here too On Mon, Jun 3, 2013 at 12:57 PM, Domenic Denicola dome...@domenicdenicola.com wrote: I really dislike `export =`. It looks like it

Re: Module syntax

2013-06-03 Thread Andrea Giammarchi
if ``` function x() {} export default x; ``` works thought, that ain't any different from returning function expression where you cannot reuse that function if not inside the function itself. It does not look like a big lost but more similar to expression logic we are use to with JS ... or, is

Re: Behavior of () = {'use strict'; return typeof this }

2013-06-06 Thread Andrea Giammarchi
which means it breaks explicit 'use strict' directive so, in my opinion, is a legit question or, at least, this should be mentioned in the MDN page ? On Thu, Jun 6, 2013 at 12:52 PM, David Bruant bruan...@gmail.com wrote: Le 06/06/2013 12:49, David Bruant a écrit : Hi, Should the use

Re: Behavior of () = {'use strict'; return typeof this }

2013-06-06 Thread Andrea Giammarchi
and for it breaks I meant it feels broken ... this is not a real issue but MDN should mention it to avoid any sort of confusion. I'll edit that page, cheers On Thu, Jun 6, 2013 at 12:54 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: which means it breaks explicit 'use strict

Re: Behavior of () = {'use strict'; return typeof this }

2013-06-06 Thread Andrea Giammarchi
feel fere to update/change/improve my quick note in that page, thanks. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/arrow_functions ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Array.prototype.find

2013-06-06 Thread Andrea Giammarchi
I guess just consistency with other Array#forEach/map/every,etc,etc methods plus you don't need to create N bound functions or N arrow functions per each Array#find call ... or not? On Thu, Jun 6, 2013 at 1:20 PM, Jussi Kalliokoski jussi.kallioko...@gmail.com wrote: What would be the use case

Re: Array.prototype.find

2013-06-06 Thread Andrea Giammarchi
the fact reduce/Right a part all methods accept a thisValue ... I am happy with current method though, still not sure if thisValue will be commonly needed or not. On Thu, Jun 6, 2013 at 3:44 PM, Rick Waldron waldron.r...@gmail.com wrote: On Thu, Jun 6, 2013 at 4:43 PM, Andrea Giammarchi

Re: Array.prototype.find

2013-06-07 Thread Andrea Giammarchi
yep, I followed Jussi ... it's his fault :P sorry I misunderstood too On Fri, Jun 7, 2013 at 7:03 AM, Jussi Kalliokoski jussi.kallioko...@gmail.com wrote: Oops, my bad, sorry about that. On Jun 7, 2013 3:37 AM, Axel Rauschmayer a...@rauschma.de wrote: Note: the proposed new parameter is

Object.values and/or Object.forEach ?

2013-06-07 Thread Andrea Giammarchi
it comes out from time to time devs would like to have `Object.values()` as equivalent of `Object.keys()` except the returned array would contain values. Better than repeated `Object.keys(obj).map(function(p){return this[k];}, obj);` all over but probably less useful than a more generic

Re: Object.values and/or Object.forEach ?

2013-06-07 Thread Andrea Giammarchi
would this 'polyfill' as expected or there's more about these helpers ? ```javascript this['@dict'] = { keys: Object.keys, values: function(keys){ function map(key) { return this[key]; } return function values(obj) { return keys(obj).map(map, obj); };

Re: Is __proto__ ready needed?

2013-06-10 Thread Andrea Giammarchi
yep, that's awesome ... too bad not a single engine exposed yet such easy change ever for both V8 and/or SpiderMonkey since everything is already in place, only the public method exposed to JS is missing (and for V8 I've already porposed a patch to drop the poison pill but nothing happened ...) I

Re: Why can’t for-of be applied to iterators?

2013-06-11 Thread Andrea Giammarchi
I believe Iterator should be an interface and not a class so I could extend Array or ArrayLike implementing Iterator, when/if necessary, in order to have a for/of compatible class. We don't have interfaces ... I know, we could have mixins though, compatible with @@things too. My 2 cents On

Re: Why can’t for-of be applied to iterators?

2013-06-11 Thread Andrea Giammarchi
-brock.comwrote: On Jun 11, 2013, at 10:22 AM, Andrea Giammarchi wrote: I believe Iterator should be an interface and not a class so I could extend Array or ArrayLike implementing Iterator, when/if necessary, in order to have a for/of compatible class. We don't have interfaces ... I know, we could have

Re: Why can’t for-of be applied to iterators?

2013-06-11 Thread Andrea Giammarchi
at 1:26 PM, Brian Di Palma off...@gmail.com wrote: Sorry for the OT message. On Tue, Jun 11, 2013 at 6:22 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: We don't have interfaces ... I know, we could have mixins though, compatible with @@things too. The concepts of Mixins has

Re: Why can’t for-of be applied to iterators?

2013-06-11 Thread Andrea Giammarchi
at 5:48 PM, Dmitry Soshnikov dmitry.soshni...@gmail.com wrote: On Tue, Jun 11, 2013 at 5:33 PM, Brendan Eich bren...@mozilla.com wrote: Brian Di Palma wrote: Sorry for the OT message. On Tue, Jun 11, 2013 at 6:22 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: We don't have

Re: Object.mixin( source, target ) | arguments changed

2013-06-13 Thread Andrea Giammarchi
Rick talked about a third argument but if that won't exist I like multiple sources too. It's also more suitable as Object.mixin(target, ...[source1, source2, source3]) for predefined collections of mixins to reuse +1 here On Thu, Jun 13, 2013 at 3:57 PM, Dmitry Soshnikov

Re: Object.mixin( source, target ) | arguments changed

2013-06-13 Thread Andrea Giammarchi
Seliger peter.seli...@googlemail.com wrote: If one thinks about how Andrea Giammarchi might have come up with his already reliable implementation of [Object.mixin] ... [ https://github.com/WebReflection/object-mixin/blob/master/src/object-mixin.js ] ... the need for changing the order

Re: Automatically binding extracted methods

2013-06-14 Thread Andrea Giammarchi
I think that's possible since the beginning of the time ... we just need to be a bit more pragmatic with what's available. Examples here: http://webreflection.blogspot.com/2012/11/my-name-is-bound-method-bound.html summarized as ```javascript Generic.prototype.bound = function (methodName) {

Re: Array.prototype.values() compatibility hazard

2013-06-18 Thread Andrea Giammarchi
can you try to hot-fix that via `with(values.values=values)` ? On Tue, Jun 18, 2013 at 2:59 PM, Brandon Benvie bben...@mozilla.com wrote: On 6/17/2013 6:30 PM, Brandon Benvie wrote: On 6/17/2013 4:33 PM, Jason Orendorff wrote: Firefox added Array.prototype.values() and immediately ran into

Re: Array.prototype.values() compatibility hazard

2013-06-18 Thread Andrea Giammarchi
. And so, ultimately, myself. /be Allen Wirfs-Brock wrote: On Jun 18, 2013, at 3:05 PM, Brandon Benvie wrote: On 6/18/2013 3:02 PM, Andrea Giammarchi wrote: can you try to hot-fix that via `with(values.values=values)` ? That probably works, but it matters little since the hazard

Re: On IE __proto__ test cases

2013-07-09 Thread Andrea Giammarchi
on 3.1.1-10 AFAIK `Object.preventExtension({})` makes __proto__ immutable. Since `Object.freeze({})` includes that `preventExtension` call, immutable should be so no `y` inherited there. On Thu, Jul 4, 2013 at 3:10 PM, David Bruant bruan...@gmail.com wrote: Hi, So, there are standard tests

Object#extra hazard

2013-07-10 Thread Andrea Giammarchi
Just a humble attempt to propose some addiction to the `Object.prototype` I already know many will kill me for even trying to ... **tl;dr** - everything proposed can be already tested through this utility called [eddy.js](https://github.com/WebReflection/eddy#event-driven-js) ### Event Target

Re: Object#extra hazard

2013-07-10 Thread Andrea Giammarchi
my implementation works already with `DOM` nodes and browser environment, including `window`. I've also already written an `EventTarget` mixin object but in my case I'd use that via `Object.mixin(Object.prototype, EventTarget);` 'cause almost every object I use in my logic should be observed or

<    1   2   3   4   5   6   7   8   9   10   >