2016-09-08 18:30:58 +00:00
|
|
|
// Copyright 2016 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.
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure printing different element kinds doesn't crash.
|
|
|
|
|
|
|
|
var array;
|
|
|
|
var obj = {};
|
|
|
|
|
|
|
|
array = [];
|
|
|
|
%DebugPrint(array);
|
|
|
|
|
2017-06-30 11:26:14 +00:00
|
|
|
// PACKED_SMI_ELEMENTS
|
2016-09-08 18:30:58 +00:00
|
|
|
array = [1, 2, 3];
|
|
|
|
%DebugPrint(array);
|
|
|
|
|
2017-06-30 11:26:14 +00:00
|
|
|
// HOLEY_SMI_ELEMENTS
|
2016-09-08 18:30:58 +00:00
|
|
|
array[10] = 100;
|
|
|
|
array[11] = 100;
|
|
|
|
%DebugPrint(array);
|
|
|
|
|
2017-06-30 11:26:14 +00:00
|
|
|
// PACKED_ELEMENTS
|
2016-09-08 18:30:58 +00:00
|
|
|
array = [1, obj, obj];
|
|
|
|
%DebugPrint(array);
|
|
|
|
|
2017-06-30 11:26:14 +00:00
|
|
|
// HOLEY_ELEMENTS
|
2016-09-08 18:30:58 +00:00
|
|
|
array[100] = obj;
|
|
|
|
array[101] = obj;
|
|
|
|
%DebugPrint(array);
|
|
|
|
|
2017-06-30 11:26:14 +00:00
|
|
|
// PACKED_DOUBLE_ELEMENTS
|
2016-09-08 18:30:58 +00:00
|
|
|
array = [1.1, 2.2, 3.3, 3.3, 3.3, NaN];
|
|
|
|
%DebugPrint(array);
|
|
|
|
array.push(NaN);
|
|
|
|
array.push(NaN);
|
|
|
|
%DebugPrint(array);
|
|
|
|
|
2017-06-30 11:26:14 +00:00
|
|
|
// HOLEY_DOUBLE_ELEMENTS
|
2016-09-08 18:30:58 +00:00
|
|
|
array[100] = 1.2;
|
|
|
|
array[101] = 1.2;
|
|
|
|
%DebugPrint(array);
|
|
|
|
|
|
|
|
// DICTIONARY_ELEMENTS
|
|
|
|
%NormalizeElements(array);
|
|
|
|
%DebugPrint(array);
|