From 1f12e43a0f6c45c5b1c4bfb9a0df0621d7622529 Mon Sep 17 00:00:00 2001 From: dashodanger <> Date: Tue, 3 Dec 2024 09:37:17 -0700 Subject: [PATCH 1/2] Add missing options.support_node check when using preload cache --- tools/file_packager.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/file_packager.py b/tools/file_packager.py index 5c48543588d16..65df3df223339 100755 --- a/tools/file_packager.py +++ b/tools/file_packager.py @@ -787,10 +787,13 @@ def generate_js(data_target, data_files, metadata): var DB_VERSION = 1; var METADATA_STORE_NAME = 'METADATA'; var PACKAGE_STORE_NAME = 'PACKAGES'; - function openDatabase(callback, errback) { - if (isNode) { - return errback(); - } + function openDatabase(callback, errback) {''' + if options.support_node: + code =+ ''' + if (isNode) { + return errback(); + }''' + code += ''' var indexedDB; if (typeof window === 'object') { indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB; From 6b19c351ddc2087a98b8677ed8e0c9e519792bdd Mon Sep 17 00:00:00 2001 From: dashodanger <> Date: Tue, 3 Dec 2024 10:58:05 -0700 Subject: [PATCH 2/2] Correct operator --- tools/file_packager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/file_packager.py b/tools/file_packager.py index 65df3df223339..d76e245b8eb7c 100755 --- a/tools/file_packager.py +++ b/tools/file_packager.py @@ -789,7 +789,7 @@ def generate_js(data_target, data_files, metadata): var PACKAGE_STORE_NAME = 'PACKAGES'; function openDatabase(callback, errback) {''' if options.support_node: - code =+ ''' + code += ''' if (isNode) { return errback(); }'''