Closed Bug 757683 Opened 13 years ago Closed 13 years ago

Debugger.findScripts does not find all scripts

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 738480

People

(Reporter: jcranmer, Unassigned)

Details

Simplified testcase (this needs two files): --> test.js <-- Components.utils.import("resource:///modules/jsdebugger.jsm"); Components.utils.import("resource:///modules/Services.jsm"); Components.utils.import("file:///tmp/component.js"); addDebuggerToGlobal(this); var Coverage = {}; (function(){ let dump = Components.utils.getGlobalForObject(this).dump; let _debugger = null; let frames = []; this.captureFrames = function captureFrames(object) { _debugger = new Debugger(object); _debugger.onEnterFrame = onEnterFrame; _debugger.enabled = true; }; function onEnterFrame(frame) { frame.onStep = function onStep() { dump("Do you see me?\n"); frames.push(["line", this.script]); }; } var Observer = { observe : function (subject, topic, data) { dump("Number of scripts: " + _debugger.findScripts().length + '\n'); dump("Frames.length: " + frames.length + '\n'); } }; Services.obs.addObserver(Observer, "xpcom-will-shutdown", false); }).apply(Coverage); Coverage.captureFrames(Parser); new Parser().aFunc(); --> component.js <-- (place in /tmp/component.js, or modify line 3 above) function Parser() {} Parser.prototype = { aFunc: function someFunction() { return this; } }; var EXPORTED_SYMBOLS = ["Parser"]; Results: jcranmer@xochiquetzal /tmp $ /src/build/trunk/mail/mozilla/dist/bin/run-mozilla.sh /src/build/trunk/mail/mozilla/dist/bin/xpcshell -f test.js Do you see me? Do you see me? Do you see me? Number of scripts: 0 Frames.length: 3 (Bugzilla suggested bug 738480 as a possible duplicate, but I don't know enough to say if this is true or not).
Reproduced. The behavior is really perplexing. findScripts just doesn't find anything no matter what I do.
Oh, surely this is just a duplicate of bug 738480. That shouldn't be terribly hard to fix.
Fix is up in bug 738480. Closing.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.