Closed Bug 855112 Opened 12 years ago Closed 12 years ago

OS.File.read fails with a "reference to undefined property options.bytes" JS Error

Categories

(Toolkit Graveyard :: OS.File, defect)

19 Branch
x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla22

People

(Reporter: florian, Assigned: florian)

Details

Attachments

(1 file)

I tried using OS.File.read on the main thread in a JS module. It failed with this error: JS Component Loader: ERROR resource://gre/modules/osfile/osfile_async_front.jsm:106 Error: Queue is empty I enabled DEBUG in osfile_async_front.jsm and got this JS error: OS Controller Received uncaught error from worker "reference to undefined property options.bytes" reference to undefined property options.bytes I poked a bit at the code, http://hg.mozilla.org/mozilla-central/annotate/c9bf19d37fe0/toolkit/components/osfile/osfile_shared_front.jsm#l57 seems to be a Number, but at http://hg.mozilla.org/mozilla-central/annotate/c9bf19d37fe0/toolkit/components/osfile/osfile_shared_front.jsm#l85 an object seems expected. I tried changing line 57 to: let size = this.readTo(buffer, {bytes: bytes}); and my code worked, but that's just a random guess. I tried this with Mozilla 19, so the bug may be already fixed, but the code I edited is still present on mozilla-central, so I would rather file a dup then let this go unreported.
Your fix is very likely correct. Could you please submit a patch?
Attached patch PatchSplinter Review
Patch as suggested in comment 0.
Assignee: nobody → florian
Attachment #730061 - Flags: review?(dteller)
Comment on attachment 730061 [details] [diff] [review] Patch Review of attachment 730061 [details] [diff] [review]: ----------------------------------------------------------------- r=me if this passes tests Thanks for the bugfix!
Attachment #730061 - Flags: review?(dteller) → review+
(In reply to David Rajchenbach Teller [:Yoric] from comment #3) > r=me if this passes tests Tests look green to me on try: https://tbpl.mozilla.org/?tree=Try&rev=c2ea9edc460b https://hg.mozilla.org/integration/mozilla-inbound/rev/6b3122df808d
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: