Welcome! Log In Create A New Profile

Advanced

[njs] Improved array allocation test for low memory machines.

Alexander Borisov
April 22, 2019 11:08AM
details: https://hg.nginx.org/njs/rev/72252310ae3f
branches:
changeset: 916:72252310ae3f
user: Alexander Borisov <alexander.borisov@nginx.com>
date: Mon Apr 22 18:06:17 2019 +0300
description:
Improved array allocation test for low memory machines.

diffstat:

njs/test/njs_unit_test.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)

diffs (20 lines):

diff -r 3869b6e1f296 -r 72252310ae3f njs/test/njs_unit_test.c
--- a/njs/test/njs_unit_test.c Sun Apr 21 17:36:25 2019 +0800
+++ b/njs/test/njs_unit_test.c Mon Apr 22 18:06:17 2019 +0300
@@ -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(",,") },
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Improved array allocation test for low memory machines.

Alexander Borisov 299 April 22, 2019 11:08AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 263
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready