Files
formipay/node_modules/es-abstract/2018/CompletionRecord.js
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
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>
2026-04-18 17:02:14 +07:00

49 lines
1.3 KiB
JavaScript

'use strict';
var $SyntaxError = require('es-errors/syntax');
var SLOT = require('internal-slot');
// https://262.ecma-international.org/7.0/#sec-completion-record-specification-type
var CompletionRecord = function CompletionRecord(type, value) {
if (!(this instanceof CompletionRecord)) {
return new CompletionRecord(type, value);
}
if (type !== 'normal' && type !== 'break' && type !== 'continue' && type !== 'return' && type !== 'throw') {
throw new $SyntaxError('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');
}
SLOT.set(this, '[[Type]]', type);
SLOT.set(this, '[[Value]]', value);
// [[Target]] slot?
};
CompletionRecord.prototype.type = function Type() {
return SLOT.get(this, '[[Type]]');
};
CompletionRecord.prototype.value = function Value() {
return SLOT.get(this, '[[Value]]');
};
CompletionRecord.prototype['?'] = function ReturnIfAbrupt() {
var type = SLOT.get(this, '[[Type]]');
var value = SLOT.get(this, '[[Value]]');
if (type === 'throw') {
throw value;
}
return value;
};
CompletionRecord.prototype['!'] = function assert() {
var type = SLOT.get(this, '[[Type]]');
if (type !== 'normal') {
throw new $SyntaxError('Assertion failed: Completion Record is not of type "normal"');
}
return SLOT.get(this, '[[Value]]');
};
module.exports = CompletionRecord;