From 097b3b2e9e890991464f452b430e5adf4441580a Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 24 Jan 2025 16:24:47 -0800 Subject: [PATCH] Inline URIUtils.js. NFC This is only three lines and doesn't warrant a separate file. Prior to #23297 it did need to be separately usable. --- eslint.config.mjs | 1 - src/URIUtils.js | 14 -------------- src/preamble.js | 15 ++++++++++++++- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index f05b3d29f9c2d..efaf92d5d7df5 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -59,7 +59,6 @@ export default [{ 'src/proxyWorker.js', 'src/proxyClient.js', 'src/IDBStore.js', - 'src/URIUtils.js', 'tools/experimental', ], }, ...compat.extends('prettier'), js.configs.recommended, { diff --git a/src/URIUtils.js b/src/URIUtils.js index 6f098fcf9f269..2463b93758bd3 100644 --- a/src/URIUtils.js +++ b/src/URIUtils.js @@ -4,17 +4,3 @@ * SPDX-License-Identifier: MIT */ -// Prefix of data URIs emitted by SINGLE_FILE and related options. -var dataURIPrefix = 'data:application/octet-stream;base64,'; - -/** - * Indicates whether filename is a base64 data URI. - * @noinline - */ -var isDataURI = (filename) => filename.startsWith(dataURIPrefix); - -/** - * Indicates whether filename is delivered via file protocol (as opposed to http/https) - * @noinline - */ -var isFileURI = (filename) => filename.startsWith('file://'); diff --git a/src/preamble.js b/src/preamble.js index fb62ee4b609ae..db1f9db29a93a 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -140,7 +140,20 @@ var runtimeInitialized = false; var runtimeExited = false; #endif -#include "URIUtils.js" +// Prefix of data URIs emitted by SINGLE_FILE and related options. +var dataURIPrefix = 'data:application/octet-stream;base64,'; + +/** + * Indicates whether filename is a base64 data URI. + * @noinline + */ +var isDataURI = (filename) => filename.startsWith(dataURIPrefix); + +/** + * Indicates whether filename is delivered via file protocol (as opposed to http/https) + * @noinline + */ +var isFileURI = (filename) => filename.startsWith('file://'); #include "runtime_shared.js"