OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 the V8 project authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Flags: --allow-natives-syntax | |
6 | |
7 // Make sure printing different kinds of objects doesn't crash | |
Jakob Kummerow
2016/08/31 14:56:09
nit: trailing full stop please.
| |
8 | |
9 // Different elements | |
Jakob Kummerow
2016/08/31 14:56:09
Did you mean to apply s/objects/elements/ to the p
| |
10 | |
11 var array; | |
12 var obj = {}; | |
13 | |
14 array = []; | |
15 %DebugPrint(array); | |
16 | |
17 // FAST_SMI_ELEMENTS | |
18 array = [1, 2, 3]; | |
19 %DebugPrint(array); | |
20 | |
21 // FAST_HOLEY_SMI_ELEMENTS | |
22 array[10] = 100; | |
23 array[11] = 100; | |
24 %DebugPrint(array); | |
25 | |
26 // FAST_ELEMENTS | |
27 array = [1, obj, obj]; | |
28 %DebugPrint(array); | |
29 | |
30 // FAST_HOLEY_ELEMENTS | |
31 array[100] = obj; | |
32 array[101] = obj; | |
33 %DebugPrint(array); | |
34 | |
35 // FAST_DOUBLE_ELEMENTS | |
36 array = [1.1, 2.2, 3.3, 3.3, 3.3, NaN]; | |
37 %DebugPrint(array); | |
38 array.push(NaN); | |
39 array.push(NaN); | |
40 %DebugPrint(array); | |
41 | |
42 // FAST_HOLEY_DOUBLE_ELEMENTS | |
43 array[100] = 1.2; | |
44 array[101] = 1.2; | |
45 %DebugPrint(array); | |
46 | |
47 // DICTIONARY_ELEMENTS | |
48 %NormalizeElements(array); | |
49 %DebugPrint(array); | |
OLD | NEW |