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>
51 lines
1.5 KiB
JavaScript
51 lines
1.5 KiB
JavaScript
'use strict';
|
|
// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
|
|
require('../modules/es.map');
|
|
require('../modules/es.weak-map');
|
|
var getBuiltIn = require('../internals/get-built-in');
|
|
var create = require('../internals/object-create');
|
|
var isObject = require('../internals/is-object');
|
|
|
|
var $Object = Object;
|
|
var $TypeError = TypeError;
|
|
var Map = getBuiltIn('Map');
|
|
var WeakMap = getBuiltIn('WeakMap');
|
|
|
|
var Node = function () {
|
|
// keys
|
|
this.object = null;
|
|
this.symbol = null;
|
|
// child nodes
|
|
this.primitives = null;
|
|
this.objectsByIndex = create(null);
|
|
};
|
|
|
|
Node.prototype.get = function (key, initializer) {
|
|
return this[key] || (this[key] = initializer());
|
|
};
|
|
|
|
Node.prototype.next = function (i, it, IS_OBJECT) {
|
|
var store = IS_OBJECT
|
|
? this.objectsByIndex[i] || (this.objectsByIndex[i] = new WeakMap())
|
|
: this.primitives || (this.primitives = new Map());
|
|
var entry = store.get(it);
|
|
if (!entry) store.set(it, entry = new Node());
|
|
return entry;
|
|
};
|
|
|
|
var root = new Node();
|
|
|
|
module.exports = function () {
|
|
var active = root;
|
|
var length = arguments.length;
|
|
var i, it;
|
|
// for prevent leaking, start from objects
|
|
for (i = 0; i < length; i++) {
|
|
if (isObject(it = arguments[i])) active = active.next(i, it, true);
|
|
}
|
|
if (this === $Object && active === root) throw new $TypeError('Composite keys must contain a non-primitive component');
|
|
for (i = 0; i < length; i++) {
|
|
if (!isObject(it = arguments[i])) active = active.next(i, it, false);
|
|
} return active;
|
|
};
|