| Index: test/mjsunit/regress/regress-319722-ArrayBuffer.js
|
| diff --git a/test/mjsunit/stack-traces-custom-lazy.js b/test/mjsunit/regress/regress-319722-ArrayBuffer.js
|
| similarity index 72%
|
| copy from test/mjsunit/stack-traces-custom-lazy.js
|
| copy to test/mjsunit/regress/regress-319722-ArrayBuffer.js
|
| index 91d97f3739dc746434731352a0ec7ade0d839484..1849bd2247a4750336b29e68b41bbb7d6ba2d1af 100644
|
| --- a/test/mjsunit/stack-traces-custom-lazy.js
|
| +++ b/test/mjsunit/regress/regress-319722-ArrayBuffer.js
|
| @@ -25,25 +25,34 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -function testPrepareStackTrace(closure) {
|
| - var error = undefined;
|
| +// Flags: --nostress-opt --allow-natives-syntax --mock-arraybuffer-allocator
|
| +var maxSize = %MaxSmi() + 1;
|
| +var ab;
|
| +
|
| +// Allocate the largest ArrayBuffer we can on this architecture.
|
| +for (k = 8; k >= 1 && ab == null; k = k/2) {
|
| try {
|
| - closure();
|
| - assertUnreachable();
|
| + ab = new ArrayBuffer(maxSize * k);
|
| } catch (e) {
|
| - error = e;
|
| + ab = null;
|
| }
|
| +}
|
|
|
| - // We expect custom formatting to be lazy. Setting the custom
|
| - // function right before calling error.stack should be fine.
|
| - Error.prepareStackTrace = function(e, frames) {
|
| - return "bar";
|
| - }
|
| +assertTrue(ab != null);
|
|
|
| - assertEquals("bar", error.stack);
|
| - Error.prepareStackTrace = undefined;
|
| +function TestArray(constr) {
|
| + assertThrows(function() {
|
| + new constr(ab, 0, maxSize);
|
| + }, RangeError);
|
| }
|
|
|
| -testPrepareStackTrace(function() { throw new Error("foo"); });
|
| -testPrepareStackTrace(function f() { f(); });
|
| +TestArray(Uint8Array);
|
| +TestArray(Int8Array);
|
| +TestArray(Uint16Array);
|
| +TestArray(Int16Array);
|
| +TestArray(Uint32Array);
|
| +TestArray(Int32Array);
|
| +TestArray(Float32Array);
|
| +TestArray(Float64Array);
|
| +TestArray(Uint8ClampedArray);
|
|
|
|
|