Skip to content

Commit

Permalink
Split out Array.prototype.flat overflow lit test
Browse files Browse the repository at this point in the history
Summary:
This test is by far the slowest test when running under handle-san,
split it out and run it without handle-san.

Reviewed By: avp

Differential Revision: D68674231

fbshipit-source-id: 169f7c54dea50dc9bab196d63cf5e7929ec0d187
  • Loading branch information
neildhar authored and facebook-github-bot committed Jan 27, 2025
1 parent 70db249 commit 4ff8f82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
16 changes: 16 additions & 0 deletions test/hermes/array-flat-overflow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

// RUN: ulimit -s 1024 && %hermes -gc-sanitize-handles=0 %s | %FileCheck --match-full-lines %s
// RUN: ulimit -s 1024 && %shermes -exec -Wx,-gc-sanitize-handles=0 %s | %FileCheck --match-full-lines %s

var a = [1];
for (var i = 0; i < 100000; ++i) {
a = [a];
}
try { a.flat(Infinity); } catch(e) { print('caught', e.name) }
// CHECK: caught RangeError
12 changes: 3 additions & 9 deletions test/hermes/array-functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/

// RUN: ulimit -s 1024 && %hermes -target=HBC -O %s | %FileCheck --match-full-lines %s
// RUN: ulimit -s 1024 && %hermes -target=HBC -O -emit-binary -out %t.hbc %s && %hermes %t.hbc | %FileCheck --match-full-lines %s
// RUN: ulimit -s 1024 && %shermes -exec %s | %FileCheck --match-full-lines %s
// RUN: %hermes -target=HBC -O %s | %FileCheck --match-full-lines %s
// RUN: %hermes -target=HBC -O -emit-binary -out %t.hbc %s && %hermes %t.hbc | %FileCheck --match-full-lines %s
// RUN: %shermes -exec %s | %FileCheck --match-full-lines %s
"use strict";

// Performs a nested array comparison between the two arrays.
Expand Down Expand Up @@ -1103,12 +1103,6 @@ print(arrayEquals([1,[2,[3,[4]]]].flat(2), [1,2,3,[4]]));
// CHECK-NEXT: true
print(arrayEquals([1,[2,[3,[4]]]].flat(Infinity), [1,2,3,4]));
// CHECK-NEXT: true
var a = [1];
for (var i = 0; i < 100000; ++i) {
a = [a];
}
try { a.flat(Infinity); } catch(e) { print('caught', e.name) }
// CHECK-NEXT: caught RangeError

print('flatMap');
// CHECK-LABEL: flatMap
Expand Down

0 comments on commit 4ff8f82

Please sign in to comment.