Remove JSScript::filename

NEW
Unassigned

Status

()

7 years ago
4 years ago

People

(Reporter: igor, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
In FF JSScript::filename in many cases can be reconstructed from the principals associated with the script. We should consider if we can replace the filename with some hook that the embedding can provide to reconstruct the filename. As a bonus this should allow to eliminate the script file name table and associated complexity of its state management.
> In FF JSScript::filename in many cases can be reconstructed from the principals
> associated with the script.

That's likely to stop being true when we implement CORS for scripts.

In general, it's better to not conflate "where the content came from" (which is what consumers for .filename want) and "the security policy associated with the content" (which is what principals represent).  The latter tends to be determined by the former in many cases, but by no means all of them.

That said, I agree that storing the filename as a _string_ is a PITA.  If Gecko could just store it as a principal, that would make the common cases much smaller (because it would just be one of the existing subject/object principals).

I have to admit that my suggested naming for "originPrincipals" might have been suboptimal in this regard; they really represent the script's "object principal", whereas "principals" represents its "subject principal".
(Assignee)

Updated

4 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.