From: Alexander Borisov Date: Mon, 22 Apr 2019 15:06:17 +0000 (+0300) Subject: Improved array allocation test for low memory machines. X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/gitweb.js?a=commitdiff_plain;h=38728b694a9ad12270a101bb17ce53f6bc2d7931;p=njs.git Improved array allocation test for low memory machines. --- diff --git a/njs/test/njs_unit_test.c b/njs/test/njs_unit_test.c index 230e2b9a..3ef5dd0f 100644 --- a/njs/test/njs_unit_test.c +++ b/njs/test/njs_unit_test.c @@ -7977,13 +7977,9 @@ static njs_unit_test_t njs_test[] = { nxt_string("var x = Array(2**28)"), nxt_string("MemoryError") }, - { nxt_string("var r; try {" - " var x = Array(2**27), y = Array(2**5).fill(x);" - " Array.prototype.concat.apply(y[0], y.slice(1));" - "} catch (e) {" - " r = e.name == 'InternalError' || e.name == 'RangeError'" - "} r"), - nxt_string("true") }, + { nxt_string("var x = Array(2**20), y = Array(2**12).fill(x);" + "Array.prototype.concat.apply(y[0], y.slice(1))"), + nxt_string("RangeError: Invalid array length") }, { nxt_string("var a = new Array(3); a"), nxt_string(",,") },