Closed Bug 729338 Opened 12 years ago Closed 14 days ago

Remove JSScript::filename

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: igor, Unassigned)

Details

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: general → nobody
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 14 days ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.