Closed Bug 776439 Opened 12 years ago Closed 12 years ago

Function.toString()returns wrong file source after landing Bug 776389. if script loaded by nested mozIJSSubScriptLoader and when load subscript with url +"?1111")

Categories

(Core :: JavaScript Engine, defect)

17 Branch
x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: alice0775, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

Build Identifier:
http://hg.mozilla.org/integration/mozilla-inbound/rev/d12d918df9d6
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 ID:20120722151543

Function.toString() is till broken after landing Bug 776389. if script loaded by nested mozIJSSubScriptLoader.

This happens when load subscript with url +"?1111"

Steps to Reproduce:
1. Start Nightly with new profile
2. Quit browser

3. Create a folder named chrome into the user profile folder
4. Copy attachment 644825 [details](userChrome.js) and attachment 644826 [details](bugtest.uc.js) attached file into user profile folder\chrome

5. Install attached modified userChromeJS xpi
6. Restart browser

Actual Results:
 Three alert box appear but 3rd one is wrong 
  1st: object
  2nd: function
  3rd: function e http://mozilla.zeniko.ch/userchrome.j

Expected results: 
 Three alert box appear:
  1st: object
  2nd: function
  3rd:
       function (aEvent, aXferData, aDragSession) {
       }
Summary: Function.toString()returns wrong file source landing Bug 776389. if script loaded by nested mozIJSSubScriptLoader → Function.toString()returns wrong file source landing Bug 776389. if script loaded by nested mozIJSSubScriptLoader and when load subscript with url +"?1111")
Summary: Function.toString()returns wrong file source landing Bug 776389. if script loaded by nested mozIJSSubScriptLoader and when load subscript with url +"?1111") → Function.toString()returns wrong file source after landing Bug 776389. if script loaded by nested mozIJSSubScriptLoader and when load subscript with url +"?1111")
Can you state what the modification is to the xpi?
(In reply to Benjamin Peterson from comment #1)
> Can you state what the modification is to the xpi?

I added "?11111" to script URl which is loaded by loadSubScript.
(Usualy, I added the script file date-time in order to avoid being read from cash)

in line 140: userChromeJS_test.xpi\components\userChrome_js.js
  handleEvent: function(aEvent) {
    var document = aEvent.originalTarget;
    if (document.location && document.location.protocol == "chrome:") {
      try {
        let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
                     getService(Ci.mozIJSSubScriptLoader);

        loader.loadSubScript("chrome://userChromeJS/content/userChromeJS.js",
                             document.defaultView,
                             "UTF-8");

>      loader.loadSubScript(this.mFileURL+"?1111111",
                             document.defaultView,
                             "UTF-8");
      }
      catch (ex) {
        // script execution can be stopped with |throw "stop";|
        if (ex !== "stop") {
          Cu.reportError(ex);
        }
      }
    }
  }
s/from cash/from cache/
This was fixed by bug 776430
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: