Commit 9b504257 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[foozzie] Mock out typed array set function to suppress range error

NOTRY=true

Bug: chromium:728867
Change-Id: Ie116021aab9d72d01e1532036cb5de8f4b2bd2ab
Reviewed-on: https://chromium-review.googlesource.com/522663Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45689}
parent 7fa071a4
......@@ -43,3 +43,24 @@
Float32Array = mock(Float32Array);
Float64Array = mock(Float64Array);
})();
// Mock typed array set function and limit maximum offset to 1MiB.
(function () {
var typedArrayTypes = [
Int8Array,
Uint8Array,
Uint8ClampedArray,
Int16Array,
Uint16Array,
Int32Array,
Uint32Array,
Float32Array,
Float64Array,
];
for (let typedArrayType of typedArrayTypes) {
let set = typedArrayType.prototype.set
typedArrayType.prototype.set = function(array, offset) {
set.apply(this, [array, offset > 1048576 ? 1048576 : offset])
};
}
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment