2019-10-21 22:34:48 +03:00
|
|
|
/**
|
2021-12-31 02:06:42 +03:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2019-10-21 22:34:48 +03:00
|
|
|
*
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
*/
|
|
|
|
|
2020-04-15 20:38:40 +03:00
|
|
|
// RUN: echo "var obj ={0" ":0,"{1..65535} ":0};" | %hermes - -target=HBC -O -gc-sanitize-handles=0
|
2019-07-10 19:43:32 +03:00
|
|
|
// REQUIRES: !slow_debug
|
|
|
|
|
|
|
|
// The above echo generates JavaScript code like this:
|
|
|
|
// var obj = {
|
|
|
|
// 0:0,
|
|
|
|
// 1:0,
|
|
|
|
// 2:0,
|
|
|
|
// 3:0,
|
|
|
|
// ...
|
|
|
|
// 65535:0
|
|
|
|
// };
|
|
|
|
// It's a literal object that contains 65536 literal entries. This test is used
|
|
|
|
// to exercise literal object optimizations and make sure it handles size of literal
|
|
|
|
// objects that does not fit in 2 bytes.
|
|
|
|
//
|
|
|
|
// This test was one of HandleSan's slowest at 130 seconds, so
|
|
|
|
// -gc-sanitize-handles=0 is passed to reduce the risk of a test timeout.
|