Page MenuHomePhorge

test_apply_argument_length_limit.cjs
No OneTemporary

Size
625 B
Referenced Files
None
Subscribers
None

test_apply_argument_length_limit.cjs

function assert(condition, message) {
if (!condition) {
console.log("FAIL: " + message);
throw new Error(message);
}
}
const tooLong = { length: 2147483648 };
let applyThrew = false;
try {
(function () {}).apply(null, tooLong);
} catch (e) {
applyThrew = e instanceof RangeError;
}
let reflectThrew = false;
try {
Reflect.apply(function () {}, null, tooLong);
} catch (e) {
reflectThrew = e instanceof RangeError;
}
assert(applyThrew, "Function.prototype.apply should reject oversized argument lists");
assert(reflectThrew, "Reflect.apply should reject oversized argument lists");
console.log("OK");

File Metadata

Mime Type
application/javascript
Expires
Sun, May 17, 3:45 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
554887
Default Alt Text
test_apply_argument_length_limit.cjs (625 B)

Event Timeline