Kevin Smith wrote:
I always disliked that some functions in ECMAScript 5 can be invoked
as either a function or a constructor. What would you want an entity
Foo for that can be invoked in two ways? E.g.:
new Foo(...)
Foo(...)
My answer to this is probably a
Can someone confirm/reject that by spec (http://es5.github.com/#x15.4.4.12):
// sparse array ;D
var a=[0];
a[2]=2;
// the resulting arrays length should be 1 and not 2
console.log(a.splice(0, 2).length);
I'm seeing `2` in latest Chrome/FF.
Thanks,
-JDD
Axel Rauschmayer wrote:
As I've said a couple of times here, we could try again to reach
consensus on making () as empty arrow formal parameter list optional,
Seems useful, but not worth upsetting anyone over.
The issue may not be undiagnosed upset-ness, rather ASI.
Leaving out () in front
I think separating [[Call]] and [[Construct]] to different bodies might be
a good idea. But to preserve flexibility, I also think that if you do
MyClass.call(Object.create(MyClass.prototype));
it should call the [[Construct]]. i.e. if it should use [[Construct]] when
'this' is an instance of the
MyClass.call(Object.create(MyClass.prototype));
it should call the [[Construct]]. i.e. if it should use [[Construct]] when
'this' is an instance of the class (inherits from it's prototype).
Of course, the above is equivalent to just new MyClass(...) (I think),
but I see your point. It may
This is a spec. bug. Immediately before line10 of the algorithm there should
be a line that says:
Call the [[Put]] internal method of A with arguments length,
actualDeleteCount, and true.
The ES3 spec. has the equivalent of the above line. It was apparently
inadvertently dropped
now https://bugs.ecmascript.org/show_bug.cgi?id=332
On Apr 9, 2012, at 8:51 AM, Allen Wirfs-Brock wrote:
This is a spec. bug. Immediately before line10 of the algorithm there
should be a line that says:
Call the [[Put]] internal method of A with arguments length,
On Apr 7, 2012, at 1:17 PM, Herby Vojčík wrote:
I have actually looked at the links (I confess I did not want to browse
though another way to ruin (nearly a) consensus on max-min), and I must admit
I like it.
My reaction to Kevin's initial post was much the same as Herby's. I'm just not
Kyle Murray wrote:
Two dots are (in some contexts) the descendant access operator in E4X,
so that might have had something to do with the decision.
Even in plain JS without E4X [1], two dots are one way to access
prototype methods of a floating point literal:
js 42..toString(16)
2a
and
Hello,
this is more a conceptual question post. But first some proposals that
circulated in the list:
1. Dynamic-this enabled fat arrow functions.
(this, ...) = expr
(this, ...) = { body }
2. ABC (apply/bind/call) shortcuts.
thisobj::identifier(...args) // apply
thisobj::identifier // bind
On Mon, Apr 9, 2012 at 10:46 AM, Herby Vojčík he...@mailbox.sk wrote:
Hello,
this is more a conceptual question post. But first some proposals that
circulated in the list:
1. Dynamic-this enabled fat arrow functions.
(this, ...) = expr
(this, ...) = { body }
2. ABC (apply/bind/call)
I had been working on a proposal for the bind operator which incorporated
short functions, but after consensus was reached on short functions I
didn't bother posting it. I think it still has some interesting ideas that
you might like. I've posted it here https://gist.github.com/2345080
tl;dr:
I like dynamic this.
I favor hard-bound lexical |this| for standalone function calls only. Thats
where the problems are right now
The (this, ...) syntax seems unnecessarily gnarly - better to just default
to using base ref as |this| in a method call - since by now this is
expected behavior
On
Erik Arvidsson wrote:
Fortunately all the Array.prototype methods are generic so it all just works.
Except without a new protocol (opt-in, for backward compat) the pure
methods all create a new Array instance to return, not a new NodeList.
Is that considered potentially problematic?
Allen
On Apr 7, 2012, at 1:40 PM, Erik Arvidsson wrote:
This does not work for rest parameter since ... is only allowed inside
array literals.
var tail = (x, ...xs) = xs;
This can of course be solved in numerous ways but it is not true that
the Expression is a cover grammar for
On Mon, Apr 9, 2012 at 5:05 PM, David Herman dher...@mozilla.com wrote:
On Apr 7, 2012, at 1:40 PM, Erik Arvidsson wrote:
This does not work for rest parameter since ... is only allowed inside
array literals.
var tail = (x, ...xs) = xs;
This can of course be solved in numerous ways
Russell Leggett wrote:
Or allow it in the grammar and then disallow it in the
post-processing. IOW, a cover grammar doesn't have to force us to
introduce new syntactic forms, they just force us to put them in
the *grammar*. The post-processing, which essentially defines the
This gist about ClojureScript
https://gist.github.com/2346460
reminded me of this thread. I need to spend more time learning
ClojureScript; maybe someone who knows it has a thought.
/be
Irakli Gozalishvili wrote:
I have prototyped desugared version of callable objects here:
I keep finding the frame problem overrated, specially in this case where
the case you are passing DOM nodes between frames is ... well, extremely
edge?
If NodeList.prototype is instanceof Array then this check is all you need
before Array.isArray(nl) but generally speaking I agree is never that
19 matches
Mail list logo