Having Array.prototype.remove and calling pushPermissions causes exception

RESOLVED FIXED in mozilla24

Status

RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: Luqman, Assigned: martijn.martijn)

Tracking

unspecified
mozilla24
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Created attachment 736449 [details]
Test case

Ran into this with the DeviceStorage tests which have Array.prototype.remove in devicestorage_common.js


Log is not very helpful:


  I/GeckoDump(  281): TEST-UNEXPECTED-FAIL | unknown test url | uncaught exception - uncaught exception: Error at :0
  E/GeckoConsole(  281): [JavaScript Error: "uncaught exception: Error"]
  E/GeckoConsole(  281): [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "http://mochi.test:8888/tests/dom/devicestorage/test/test_basic.html?autorun=1&closeWhenDone=1&logFile=%2Fdata%2Flocal%2Ftests%2Flogs%2Fmochitest.log&fileLevel=INFO&consoleLevel=INFO&hideResultsTable=1" line: 0}]
So this is probably because:
http://mxr.mozilla.org/mozilla-central/source/testing/specialpowers/content/specialpowersAPI.js#513

is iterating over the array that gets passed in, and it's probably hitting "remove" in there and failing.

That devicestorage_common.js bit should probably use Object.createProperty and make it a non-enumerable property.
(Reporter)

Updated

6 years ago
Depends on: 861456
(Assignee)

Comment 2

5 years ago
Created attachment 750177 [details] [diff] [review]
patch

Ok, this seems to work.
It doesn't cause any js errors with the testcase and the devicestorage tests also pass with this code.
Attachment #750177 - Flags: review?(ted)
Attachment #750177 - Flags: review?(ted) → review+
(Assignee)

Comment 3

5 years ago
Created attachment 750356 [details] [diff] [review]
patch for checkin
Attachment #750177 - Attachment is obsolete: true
(Assignee)

Updated

5 years ago
Assignee: nobody → martijn.martijn
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/3287f47bec54
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.