[Webkit-unassigned] [Bug 40970] [PATCH] Add equivalent of one-argument Array constructor functionality to JSC C API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 23 09:03:17 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40970





--- Comment #2 from Geoffrey Garen <ggaren at apple.com>  2010-06-23 09:03:17 PST ---
I see two requests in this bug.

1. "I want a way to create an array with an initial length".

I don't think it's a good idea to match the quirk of the JavaScript Array constructor here. It's a very confusing behavior to the uninitiated, and one we intentionally avoided in the API design.

The simple way to get this behavior in the current API is to make an array and then set its length property. That seems sufficient to me.

Plus, an author who really really wants the quirks of the Array constructor can just call the Array constructor.

2. "I want a way to preallocate the Array's internal storage, for performance reasons".

Can you give me an example of a case where the Array's built-in behavior is insufficient?

If there is such a case, I think the proper solution is to fix the built-in behavior, instead of adding to the C API. We want all array clients to go fast, not just C API clients.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list