If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

jslinux broken in Nightly

RESOLVED FIXED

Status

Tech Evangelism Graveyard
English Other
RESOLVED FIXED
7 years ago
3 years ago

People

(Reporter: jrmuizel, Unassigned)

Tracking

Details

(Reporter)

Description

7 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.
works: 2011-05-11 TM - http://hg.mozilla.org/tracemonkey/rev/b83c8374358a
fails: 2011-05-12 TM - http://hg.mozilla.org/tracemonkey/rev/5b479a987cda

Regression range:

http://hg.mozilla.org/tracemonkey/pushloghtml?fromchange=b83c8374358a&tochange=5b479a987cda
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');
}
Le.send(null);
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...
(Reporter)

Comment 7

6 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
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Component: JavaScript Engine → English Other
Product: Core → Tech Evangelism
QA Contact: general → english-other
Resolution: --- → FIXED

Updated

6 years ago
Duplicate of this bug: 657750
(Reporter)

Comment 11

6 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.