v8/test/mjsunit/regress-10782.js
Luis Fernando Pardo Sixtos 7cc6127b6a Fix for Issue 10782: Bug in semantics of ArraySetLength.
Added a comparison to throw a TypeError when the "enumerable"
field of the new descriptor doesn't match the one of the old descriptor.

Bug: v8:10782
Change-Id: I2f1acf215e597b85be5d29e22c006cbd79afcb47
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2818067
Commit-Queue: Luis Fernando Pardo Sixtos <lpardosixtos@microsoft.com>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73941}
2021-04-13 16:31:13 +00:00

11 lines
307 B
JavaScript

// Copyright 2021 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.
function f() {
let x = [0,0,0,0,0];
Object.defineProperty(x, 'length', {value : 4, enumerable : true});
}
assertThrows(f, TypeError);