Closed Bug 1680848 Opened 3 years ago Closed 3 years ago

Don't allow cloning scripts with different NonSyntactic flags

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We currently allow the various CloneAndExecuteScript APIs to be used to clone scripts when the flag does not match expected value. In practice, this leads to complex embedding behaviour so we should phase it out. The long term future is also to simply use Stencil representations instead of script cloning.

One particular case to watch for is the loadSubscript API in privileged code and it's interaction with caches. This is not a concern though since we've already been partitioning that cache behaviour here https://searchfox.org/mozilla-central/rev/6bb59b783b193f06d6744c5ccaac69a992e9ee7b/js/xpconnect/loader/mozJSSubScriptLoader.cpp#89-93 .

Assert that uses of CloneAndExecuteScript have a consistent NonSyntactic
flag. These APIs still perform cloning for the cross-realm cases. The shell
functions need small tweaks to support this invariant.

Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/29e0b1a86bf1
Don't allow cloning to change non-synactic flag. r=jandem
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: