v8/test/mjsunit/extinction/array.js
Shu-yu Guo e382e40a09 [extinction] Add builtin-subclassing flag and support in Array.{from,of}
Bug: v8:7367
Change-Id: I4240f6683945c0f60b30afe563f8f735563e4367
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2568230
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71622}
2020-12-04 19:35:50 +00:00

15 lines
470 B
JavaScript

// Copyright 2020 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: --no-builtin-subclassing
class SubArray extends Array { }
// Constructor methods
assertInstanceof(SubArray.from([1,2,3]), Array);
assertEquals(SubArray.from([1,2,3]).constructor, Array);
assertInstanceof(SubArray.of([1,2,3]), Array);
assertEquals(SubArray.of([1,2,3]).constructor, Array);