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>
33 lines
1.0 KiB
JavaScript
33 lines
1.0 KiB
JavaScript
'use strict';
|
|
|
|
var $TypeError = require('es-errors/type');
|
|
|
|
var GetIteratorFlattenable = require('es-abstract/2025/GetIteratorFlattenable');
|
|
var OrdinaryHasInstance = require('es-abstract/2025/OrdinaryHasInstance');
|
|
var OrdinaryObjectCreate = require('es-abstract/2025/OrdinaryObjectCreate');
|
|
|
|
var $Iterator = require('../Iterator/polyfill')();
|
|
var $WrapForValidIteratorPrototype = require('../WrapForValidIteratorPrototype');
|
|
|
|
var SLOT = require('internal-slot');
|
|
|
|
module.exports = function from(O) {
|
|
if (this instanceof from) {
|
|
throw new $TypeError('`Iterator.from` is not a constructor');
|
|
}
|
|
|
|
var iteratorRecord = GetIteratorFlattenable(O, 'ITERATE-STRING-PRIMITIVES'); // step 1
|
|
|
|
var hasInstance = OrdinaryHasInstance($Iterator, iteratorRecord['[[Iterator]]']); // step 2
|
|
|
|
if (hasInstance) { // step 3
|
|
return iteratorRecord['[[Iterator]]']; // step 3.a
|
|
}
|
|
|
|
var wrapper = OrdinaryObjectCreate($WrapForValidIteratorPrototype); // , ['[[Iterated]]']); // step 4
|
|
|
|
SLOT.set(wrapper, '[[Iterated]]', iteratorRecord); // step 5
|
|
|
|
return wrapper; // step 6
|
|
};
|