Closed Bug 875473 Opened 11 years ago Closed 11 years ago

Add saveFrameChain option to shell evaluate function

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
evalInFrame() has a |save| argument and when it's set we call JS_SaveFrameChain/JS_RestoreFrameChain before/after the eval-in-frame. However, when evalInFrame is used, ScriptFrameIter always "sees through" saved frame chains, for instance the following script will print all frames:

setDebug(true);
function g() {
    print(Error().stack);
}
function f() {
    evalInFrame(0, "g()", true);
}
f();

As far as I can tell there's no way to test the usual behavior of ScriptFrameIter stopping when it reaches a "saved frame chain".

The attached patch adds a saveFrameChain option to the shell's evaluate function and adds a test for it.
Attachment #753452 - Flags: review?(luke)
Attachment #753452 - Flags: review?(luke) → review+
https://hg.mozilla.org/mozilla-central/rev/e00506a9478f
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Depends on: 881999
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: