mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 09:15:24 +00:00

PR-URL: https://github.com/nodejs/node/pull/45579 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
24 lines
605 B
JavaScript
24 lines
605 B
JavaScript
// Copyright 2022 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
//
|
|
// Flags: --shared-string-table --harmony-struct
|
|
|
|
'use strict';
|
|
|
|
let fieldNames = [];
|
|
for (let i = 0; i < 999; i++) {
|
|
fieldNames.push('field' + i);
|
|
}
|
|
let s = new (new SharedStructType(fieldNames));
|
|
|
|
// Write to an out-of-object field.
|
|
(function storeOutOfObject() {
|
|
for (let i = 0; i < 100; i++) s.field998 = i;
|
|
})();
|
|
|
|
// Write to an in-object field.
|
|
(function storeInObject() {
|
|
for (let i = 0; i < 100; i++) s.field0 = i;
|
|
})();
|