Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
36 lines
1.6 KiB
JavaScript
36 lines
1.6 KiB
JavaScript
'use strict';
|
|
var shared = require('../internals/shared');
|
|
var getBuiltIn = require('../internals/get-built-in');
|
|
var uncurryThis = require('../internals/function-uncurry-this');
|
|
var isSymbol = require('../internals/is-symbol');
|
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
|
|
var Symbol = getBuiltIn('Symbol');
|
|
var $isWellKnownSymbol = Symbol.isWellKnownSymbol;
|
|
var getOwnPropertyNames = getBuiltIn('Object', 'getOwnPropertyNames');
|
|
var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf);
|
|
var WellKnownSymbolsStore = shared('wks');
|
|
|
|
for (var i = 0, symbolKeys = getOwnPropertyNames(Symbol), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) {
|
|
// some old engines throws on access to some keys like `arguments` or `caller`
|
|
try {
|
|
var symbolKey = symbolKeys[i];
|
|
if (isSymbol(Symbol[symbolKey])) wellKnownSymbol(symbolKey);
|
|
} catch (error) { /* empty */ }
|
|
}
|
|
|
|
// `Symbol.isWellKnownSymbol` method
|
|
// https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol
|
|
// We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected
|
|
module.exports = function isWellKnownSymbol(value) {
|
|
if ($isWellKnownSymbol && $isWellKnownSymbol(value)) return true;
|
|
try {
|
|
var symbol = thisSymbolValue(value);
|
|
for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) {
|
|
// eslint-disable-next-line eqeqeq -- polyfilled symbols case
|
|
if (WellKnownSymbolsStore[keys[j]] == symbol) return true;
|
|
}
|
|
} catch (error) { /* empty */ }
|
|
return false;
|
|
};
|