blob: 9cc97a918664bf1224a83a4c9746f1e9675c88ab [file] [log] [blame]
description("Test to ensure TypedArray filter is shielded from Array.prototype.push modifications");
const ArrayPrototypePushBackup = Array.prototype.push;
Array.prototype.push = function()
{
testFailed("Int8Array.prototype.push should not be called by builtin code");
return ArrayPrototypePushBackup.apply(this, arguments);
}
try {
array = Int8Array.from("1234").filter(function(value) {
return value === 1;
});
shouldBeTrue("array.length === 1");
}
finally {
Array.prototype.push = ArrayPrototypePushBackup;
}