Simplify the FileSpec class, and remove no longer needed polyfills#20596
Merged
timvandermeij merged 5 commits intomozilla:masterfrom Jan 29, 2026
Merged
Simplify the FileSpec class, and remove no longer needed polyfills#20596timvandermeij merged 5 commits intomozilla:masterfrom
FileSpec class, and remove no longer needed polyfills#20596timvandermeij merged 5 commits intomozilla:masterfrom
Conversation
Also, tweak code/comment used when handling "GoToR" destinations.
…e code Given that only the `FileSpec.prototype.serializable` getter is ever invoked from "outside" of the class, and only once per `FileSpec`-instance, the caching/shadowing isn't actually necessary. Furthermore the `_contentRef`-caching wasn't actually correct, since it ended up storing a `BaseStream`-instance and those should *generally* never be cached. (Since calling `BaseStream.prototype.getBytes()` more than once, without resetting the stream in between, will return an empty TypedArray after the first time.)
Collaborator
Author
|
/botio test |
Collaborator
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/8e4202c8d4a1b03/output.txt |
Collaborator
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/7390f958a03e63c/output.txt |
Collaborator
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/7390f958a03e63c/output.txt Total script time: 41.68 mins
Image differences available at: http://54.241.84.105:8877/7390f958a03e63c/reftest-analyzer.html#web=eq.log |
Collaborator
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/8e4202c8d4a1b03/output.txt Total script time: 81.73 mins
Image differences available at: http://54.193.163.58:8877/8e4202c8d4a1b03/reftest-analyzer.html#web=eq.log |
…totype.serializable` It's more correct to return the `rawFilename` as-is, and limit the fallback for empty filenames to only the `filename` property.
(During rebasing of the previous patches I happened to look at the polyfills and noticed that this one could be removed now.) Note: - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/try#browser_compatibility - https://bugzilla.mozilla.org/show_bug.cgi?id=1928493
…se64()`, and `Uint8Array.fromBase64()` polyfills (During rebasing of the previous patches I happened to look at the polyfills and noticed that this one could be removed now.) See: - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toHex#browser_compatibility - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/toBase64#browser_compatibility - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64#browser_compatibility Note that technically this functionality can still be disabled via a preference in Firefox, however that's slated for removal in [bug 1985120](https://bugzilla.mozilla.org/show_bug.cgi?id=1985120). Looking at the Firefox source-code, see https://searchfox.org/firefox-main/search?q=array.tobase64%28%29&path=&case=false®exp=false, you can see that it's already being used *unconditionally* elsewhere in the browser hence removing the polyfills ought to be fine (since toggling the preference would break other parts of the browser).
6e46246 to
5b368dd
Compare
timvandermeij
approved these changes
Jan 29, 2026
Contributor
|
Thank you for improving this code! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.