jslinux broken in Nightly



8 years ago
4 years ago


(Reporter: jrmuizel, Unassigned)





8 years ago
http://bellard.org/jslinux/ works in Aurora but not in the nightly from 2011-05-16.

It gives a "invalid arguments" error in the console.
Bug 649133 removed mozResponseArrayBuffer. jslinux uses response/responseType like this:
Le = new XMLHttpRequest();
Le.open('GET', Ke, false);
if (Le.hasOwnProperty('responseType')) {
    Le.responseType = 'arraybuffer';
} else {
    Le.overrideMimeType('text/plain; charset=x-user-defined');
if (Le.status != 200 && Le.status != 0) {
    throw "Error while loading " + Ke;
if (Le.mozResponseArrayBuffer) {
    Me = Le.mozResponseArrayBuffer;
} else if (Le.hasOwnProperty('responseType')) {
    Me = Le.response;
} else {
    Me = Le.responseText;
fd = Me.byteLength;
Ne = new Uint8Array(Me, 0, fd);
for (i = 0; i < fd; i++) {
    this.st8_phys(ha + i, Ne[i]);
return fd;
Blocks: 649133
javascript:alert(new XMLHttpRequest().hasOwnProperty("responseType"));

This alerts |true| in Chrome, |false| in Firefox 6.
> new XMLHttpRequest().hasOwnProperty("responseType")
This test doesn't look correct to me. It should be
> XMLHttpRequest.prototype.hasOwnProperty("responseType")
per WebIDL <http://dev.w3.org/2006/webapi/WebIDL/>.
Unfortunately the latter test doesn't work on WebKit because WebKit doesn't comply the WebIDL spec...
There are actually a number of sites now broken that were testing for mozResponseArrayBuffer....  I hope unprefixing response/responseType will fix most of them, but for jslinux we should just get the author to fix the code per comment 4.
But maybe we should keep mozResponseArrayBuffer for now...

Comment 7

8 years ago
(In reply to comment #5)
> for jslinux we should just get the author to fix the
> code per comment 4.

I've emailed Fabrice about this.
i guess I would be fine with bringing mozResponseArrayBuffer back for a release if we also put a warning in the error console when it's used.

However I wonder how much trouble this will be in practice since it's a very new property and it sites which are using it should still be maintained. And there's always the risk that keeping it longer will just mean that more sites come to depend on it.
Yeah, fair.  Let's not worry about it for now, then; we can bring it back in aurora or beta if it becomes an issue.

The page has been changed to use 'in' instead of hasOwnProperty.  Now we just need to remove the prefixing on reponseType/response.  ;)
Assignee: general → english-other
Last Resolved: 8 years ago
Component: JavaScript Engine → English Other
Product: Core → Tech Evangelism
QA Contact: general → english-other
Resolution: --- → FIXED


8 years ago
Duplicate of this bug: 657750

Comment 11

8 years ago
jslinux now works in the nightly
"'mozResponseType' in" test is no longer required because responseType/response properties have been unprefixed. No versions of Firefox will be shipped with the prefixed mozResponseType/mozResponse.
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.