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>
27 lines
1019 B
JavaScript
27 lines
1019 B
JavaScript
'use strict';
|
|
var call = require('../internals/function-call');
|
|
var isObject = require('../internals/is-object');
|
|
var isSymbol = require('../internals/is-symbol');
|
|
var getMethod = require('../internals/get-method');
|
|
var ordinaryToPrimitive = require('../internals/ordinary-to-primitive');
|
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
|
|
var $TypeError = TypeError;
|
|
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
|
|
|
// `ToPrimitive` abstract operation
|
|
// https://tc39.es/ecma262/#sec-toprimitive
|
|
module.exports = function (input, pref) {
|
|
if (!isObject(input) || isSymbol(input)) return input;
|
|
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
|
var result;
|
|
if (exoticToPrim) {
|
|
if (pref === undefined) pref = 'default';
|
|
result = call(exoticToPrim, input, pref);
|
|
if (!isObject(result) || isSymbol(result)) return result;
|
|
throw new $TypeError("Can't convert object to primitive value");
|
|
}
|
|
if (pref === undefined) pref = 'number';
|
|
return ordinaryToPrimitive(input, pref);
|
|
};
|