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
1.1 KiB
JavaScript
27 lines
1.1 KiB
JavaScript
'use strict';
|
|
var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;
|
|
var defineBuiltIn = require('../internals/define-built-in');
|
|
var anObject = require('../internals/an-object');
|
|
var $toString = require('../internals/to-string');
|
|
var fails = require('../internals/fails');
|
|
var getRegExpFlags = require('../internals/regexp-get-flags');
|
|
|
|
var TO_STRING = 'toString';
|
|
var RegExpPrototype = RegExp.prototype;
|
|
var nativeToString = RegExpPrototype[TO_STRING];
|
|
|
|
var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
|
|
// FF44- RegExp#toString has a wrong name
|
|
var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
|
|
|
|
// `RegExp.prototype.toString` method
|
|
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
|
|
if (NOT_GENERIC || INCORRECT_NAME) {
|
|
defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
|
|
var R = anObject(this);
|
|
var pattern = $toString(R.source);
|
|
var flags = $toString(getRegExpFlags(R));
|
|
return '/' + pattern + '/' + flags;
|
|
}, { unsafe: true });
|
|
}
|