Skip to content

Commit 5b3e913

Browse files
authored
Ensure that version_removed: false does not get generated by mirroring (#27451)
* Ensure that version_removed: false does not get generated by mirroring * Update comments
1 parent 16e71e5 commit 5b3e913

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/build/mirror.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ const matchingSafariVersions = new Map([
4141
* Convert a version number to the matching version of the target browser
4242
* @param targetBrowser The browser to mirror to
4343
* @param sourceVersion The version from the source browser
44-
* @returns The matching browser version
44+
* @returns The matching browser version, or `false` if no match is found
45+
* @throws An error when the downstream browser has no upstream
4546
*/
4647
export const getMatchingBrowserVersion = (
4748
targetBrowser: BrowserName,
@@ -239,6 +240,11 @@ export const bumpSupport = (
239240
destination,
240241
sourceData.version_removed,
241242
);
243+
244+
// Ensure that version_removed is not present if it's not applicable, such as when the upstream browser removed the feature in a newer release than a matching downstream browser
245+
if (newData.version_removed === false) {
246+
delete newData.version_removed;
247+
}
242248
}
243249

244250
if (newData.version_added === newData.version_removed) {

0 commit comments

Comments
 (0)