mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-05 02:52:39 +08:00
7f889a1a78
* support ConstantManager update * add unit test for ConstantManager handle Escape in unit test * fix `gulp build-h5-source` * publish * update deps update lock * update unit test * merge ConstantManager into StatsQuery && merge cc.config.json update * make dynamic ccGlobal optional * publish 4.3.2 and update deps * export StatsQuery * export some interface * update deps
9 lines
320 B
Plaintext
9 lines
320 B
Plaintext
function tryDefineGlobal (name, value) {
|
|
const _global = typeof window === 'undefined' ? global : window;
|
|
if (typeof _global[name] === 'undefined') {
|
|
return (_global[name] = value);
|
|
} else {
|
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
return _global[name];
|
|
}
|
|
} |