1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Revert "[HTML5] Better engine config parsing."

This reverts commit 2f509f1b12.

Breaks closure compiler builds.
And adds a warning for future readers.

(cherry picked from commit 6d3d17651a)
This commit is contained in:
Fabio Alessandrelli
2022-02-03 19:10:08 +01:00
committed by Rémi Verschelde
parent aa418d06c2
commit 4a52016aa9

View File

@@ -225,34 +225,35 @@ const InternalConfig = function (initConfig) { // eslint-disable-line no-unused-
*/ */
Config.prototype.update = function (opts) { Config.prototype.update = function (opts) {
const config = opts || {}; const config = opts || {};
const me = this; // NOTE: We must explicitly pass the default, accessing it via
function parse(key) { // the key will fail due to closure compiler renames.
function parse(key, def) {
if (typeof (config[key]) === 'undefined') { if (typeof (config[key]) === 'undefined') {
return me[key]; return def;
} }
return config[key]; return config[key];
} }
// Module config // Module config
this.unloadAfterInit = parse('unloadAfterInit'); this.unloadAfterInit = parse('unloadAfterInit', this.unloadAfterInit);
this.onPrintError = parse('onPrintError'); this.onPrintError = parse('onPrintError', this.onPrintError);
this.onPrint = parse('onPrint'); this.onPrint = parse('onPrint', this.onPrint);
this.onProgress = parse('onProgress'); this.onProgress = parse('onProgress', this.onProgress);
// Godot config // Godot config
this.canvas = parse('canvas'); this.canvas = parse('canvas', this.canvas);
this.executable = parse('executable'); this.executable = parse('executable', this.executable);
this.mainPack = parse('mainPack'); this.mainPack = parse('mainPack', this.mainPack);
this.locale = parse('locale'); this.locale = parse('locale', this.locale);
this.canvasResizePolicy = parse('canvasResizePolicy'); this.canvasResizePolicy = parse('canvasResizePolicy', this.canvasResizePolicy);
this.persistentPaths = parse('persistentPaths'); this.persistentPaths = parse('persistentPaths', this.persistentPaths);
this.persistentDrops = parse('persistentDrops'); this.persistentDrops = parse('persistentDrops', this.persistentDrops);
this.experimentalVK = parse('experimentalVK'); this.experimentalVK = parse('experimentalVK', this.experimentalVK);
this.focusCanvas = parse('focusCanvas'); this.focusCanvas = parse('focusCanvas', this.focusCanvas);
this.gdnativeLibs = parse('gdnativeLibs'); this.gdnativeLibs = parse('gdnativeLibs', this.gdnativeLibs);
this.fileSizes = parse('fileSizes'); this.fileSizes = parse('fileSizes', this.fileSizes);
this.args = parse('args'); this.args = parse('args', this.args);
this.onExecute = parse('onExecute'); this.onExecute = parse('onExecute', this.onExecute);
this.onExit = parse('onExit'); this.onExit = parse('onExit', this.onExit);
}; };
/** /**