(xpcshell?) myFunction.toString() (as in Function.toString) returns "[sourceless code]" as the function body when loading scripts via Cu.utils.import/subscriptloader

RESOLVED FIXED in Firefox 18

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: lightsofapollo, Assigned: Benjamin)

Tracking

Trunk
mozilla19
Points:
---
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(firefox18 fixed, firefox19 fixed)

Details

Attachments

(2 attachments)

(Reporter)

Description

6 years ago
Created attachment 674057 [details]
minimal test case (spans multiple files, README.md within)

This is a regression from sometime between Aug 7th mozilla central xpcshell and now. The rational behind the use of Function.toString is to send javascript function bodies over marionette for gaia integration tests. Web content appears to work as expected.
(Assignee)

Comment 1

6 years ago
Created attachment 674294 [details] [diff] [review]
set source hook in xpc

This simply moves the source hook code to XPConnect (no behavior change), so it gets used by xpcshell.
Assignee: general → benjamin
Attachment #674294 - Flags: review?(bzbarsky)
Comment on attachment 674294 [details] [diff] [review]
set source hook in xpc

r=me
Attachment #674294 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 4

6 years ago
Comment on attachment 674294 [details] [diff] [review]
set source hook in xpc

[Approval Request Comment]
Low risk patch, which just moves code around. Wanted for b2g.
Attachment #674294 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/986b4cb7678e

Should this have a test?
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment on attachment 674294 [details] [diff] [review]
set source hook in xpc

Approving as it is a low risk patch , needed for b2g
Attachment #674294 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
status-firefox18: --- → fixed
status-firefox19: --- → fixed
You need to log in before you can comment on or make changes to this bug.