Bug 22914
Summary: | The string-base64 SunSpider test uses string indexing which is not supported by the standard – but all browsers, except IE support it | ||
---|---|---|---|
Product: | WebKit | Reporter: | Shreesh Dubey <shreeshd> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | emacemac7, mjs, seth.gaurav |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://www2.webkit.org/perf/sunspider-0.9/string-base64.html |
Shreesh Dubey
When you try to access a string like an array, non-IE browsers return the character at that index but IE returns UNDEFINED. The ES3.0 standard does not support this so IE is actally behaving in a standard compliant way. However, due to this, the test later performs string operations where the keyword UNDEFINED gets converted to a string “UNDEFINED” which essentially has 8 more characters that produces incorrect result on IE. It is a simple 1-line change that does not does not affect time on other browsers, but produces correct time for IE. Here is the proposed change:
var toBase64Table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
to
var toBase64Table = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/']
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Gaurav Seth
This is for the string-base64.js test in SunSpider.
Moreover the SunSpider/tests/string-base64.js does not compute a valid base64 value.
Maciej Stachowiak
IE6 is no longer very relevant, and string indexing is part of ECMAScript 5. So likely won't change this