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
608 B
JavaScript
27 lines
608 B
JavaScript
'use strict';
|
|
|
|
var clamp = require('./clamp');
|
|
|
|
var ToNumber = require('./ToNumber');
|
|
var floor = require('./floor');
|
|
|
|
var $isNaN = require('math-intrinsics/isNaN');
|
|
|
|
// https://262.ecma-international.org/15.0/#sec-touint8clamp
|
|
|
|
module.exports = function ToUint8Clamp(argument) {
|
|
var number = ToNumber(argument); // step 1
|
|
|
|
if ($isNaN(number)) { return 0; } // step 2
|
|
|
|
var clamped = clamp(number, 0, 255); // step 4
|
|
|
|
var f = floor(clamped); // step 5
|
|
|
|
if (clamped < (f + 0.5)) { return f; } // step 6
|
|
|
|
if (clamped > (f + 0.5)) { return f + 1; } // step 7
|
|
|
|
return f % 2 === 0 ? f : f + 1; // step 8
|
|
};
|