1783cd32f1
Change-Id: Ib6ee9d9ce827c2f9f42f09292b0caca922cfde1e Reviewed-on: https://chromium-review.googlesource.com/512663 Reviewed-by: Michael Achenbach <machenbach@chromium.org> Commit-Queue: Camillo Bruni <cbruni@chromium.org> Cr-Commit-Position: refs/heads/master@{#45487}
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
// Copyright 2017 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: --allow-natives-syntax
|
|
|
|
(function TestLargeObjectDictionaryLiteral() {
|
|
// Create potential large-space object literal.
|
|
let properties = [];
|
|
// Constant chosen so the dictionary properties store lies in large object
|
|
// space.
|
|
const max = 0x1ef3e / 3;
|
|
for (let i = 0; i < max; i++) {
|
|
properties.push("p"+i);
|
|
}
|
|
let source = "return { __proto__:null, " + properties.join(":'',") + ":''}"
|
|
let createObject = new Function(source);
|
|
let object = createObject();
|
|
%HeapObjectVerify(object);
|
|
assertFalse(%HasFastProperties(object));
|
|
assertEquals(Object.getPrototypeOf(object ), null);
|
|
let keys = Object.keys(object);
|
|
// modify original object
|
|
object['new_property'] = {};
|
|
object[1] = 12;
|
|
%HeapObjectVerify(object);
|
|
|
|
let object2 = createObject();
|
|
%HeapObjectVerify(object2);
|
|
assertFalse(object2 === object);
|
|
assertFalse(%HasFastProperties(object2));
|
|
assertEquals(Object.getPrototypeOf(object2), null);
|
|
assertEquals(keys, Object.keys(object2));
|
|
})();
|