Bug 15959 - JSObject needs getToNumber to avoid costly string/number conversions
Summary: JSObject needs getToNumber to avoid costly string/number conversions
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-12 13:32 PST by Eric Seidel (no email)
Modified: 2012-09-06 17:33 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2007-11-12 13:32:32 PST
JSObject needs getAsNumber to avoid costly string/number conversions

This would be very useful for the bracket access operator on String when used in a numeric context, no create a substring to hold a single UChar.
Comment 1 Eric Seidel (no email) 2007-11-12 13:34:22 PST
Funny, we were discussing this on Friday... re-editing what you wrote and having it come out in sentence fragments.  I meant "a numeric context.  There would then be no need to create a substring...".
Comment 2 Geoffrey Garen 2007-11-12 13:35:47 PST
How does this fit in with "toNumber" and "getNumber"?

What does getAsNumber return if the value is not a number?
Comment 3 Eric Seidel (no email) 2007-11-12 14:49:05 PST
Hum... what I should have said was "getToNumber", since the idea behind all of the "evaluateToFoo" calls is that they're equivalent to to calling evaluate(exec)->toFoo(exec).  I would want the same to hold true for any get variants.  so this should be the awkward name, "getToNumber".  I feel like I'm herding values or something...
Comment 4 Gavin Barraclough 2012-09-06 17:33:05 PDT
We do now have separate paths for string/numeric property access; I don't think this bug is still tracking a viable change.