Hi,
I have just noticed [1], read all messages on this thread and thought
that the JavaScript stack size limit for
Array.prototype.push.apply(firstArray, secondArray); was an
implementation concern rather than anything else and it really sounds
weird to me to add a method just because
Le 01/11/2011 22:17, David Bruant a écrit :
(...)
Regarding implementations of .push, if they can
I meant *can't*, of course.
do as good as a .pushAll
could, then they are just buggy and should be fixed in my opinion.
___
es-discuss mailing list
On 07/31/2011 03:57 AM, Andrea Giammarchi wrote:
I agree mine is more a workaround while we need a solution but it's not about Array here,
it's about number of arguments limit per function so once we have pushAll in place, all
other methods will still suffer the apply problem
True. It seems
I agree mine is more a workaround while we need a solution but it's not
about Array here, it's about number of arguments limit per function so once
we have pushAll in place, all other methods will still suffer the apply
problem and it's not about apply either, e.g.
var tooMany =
to avoid apply limits is actually trivial:
var fromCharCode = (function ($fromCharCode, MAX_LENGTH) {
return function fromCharCode(code) {
typeof code == number (code = [code]);
for (var
result = [],
i = 0,
length = code.length;
On 07/29/2011 05:22 AM, Andrea Giammarchi wrote:
to avoid apply limits is actually trivial
More or less, yes.
But it requires the developer to anticipate the concern in advance that the
elements being appended might consume all available stack space. I don't think
most developers think at
On 07/27/2011 10:12 PM, Mark S. Miller wrote:
We could debate the pros and cons of this sort of chaining convention in
general. However, in this case I think the more important issue is API
consistency.
I was thinking this might actually be more consistent, to return this.
Consider
On 7/25/11 12:54 PM, Jeff Walden wrote:
Object.defineProperty(Array.prototype, pushAll,
{
enumerable: false, configurable: true, writable: true,
value: function pushAll(other)
{
use strict;
var t = ToObject(this);
var length = ToUint32(t.length);
var
On Wed, Jul 27, 2011 at 9:21 AM, David Flanagan dflana...@mozilla.comwrote:
Could you return this instead of undefined so that we can chain calls? For
example:
a.pushAll(b).pushAll(c).sort()
We could debate the pros and cons of this sort of chaining convention in
general. However, in this
If I have one array, and I want to append the contents of an arbitrary array to
it, and I don't need the unmodified first array after appending the second
array's elements to it, I have three options.
First, I can use Array.prototype.concat to create a new array consisting of the
first array,
It's perhaps worth noting that this problem also occurs with
String.fromCharCode. I suspect the need for a version of
|String.fromCharCode.apply(null, codesArray)| that always works, even for
super-big |codesArray|, is rather smaller than for the similar
Array.prototype.push concern.
Jeff
11 matches
Mail list logo