Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(866)

Side by Side Diff: test/mjsunit/enumeration-order.js

Issue 1159433003: Use GetProperty for getting elements. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-api-interceptors.cc ('k') | test/mjsunit/es6/indexed-integer-exotics.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // properties of the prototype object in insertion order, and so on. 64 // properties of the prototype object in insertion order, and so on.
65 // 65 //
66 // This enumeration order is not required by the specification, so 66 // This enumeration order is not required by the specification, so
67 // this just documents our choice. 67 // this just documents our choice.
68 var proto2 = {}; 68 var proto2 = {};
69 proto2[140000] = 0; 69 proto2[140000] = 0;
70 proto2.a = 0; 70 proto2.a = 0;
71 proto2[2] = 0; 71 proto2[2] = 0;
72 proto2[3] = 0; // also on the 'proto1' object 72 proto2[3] = 0; // also on the 'proto1' object
73 proto2.b = 0; 73 proto2.b = 0;
74 proto2[4294967294] = 0;
75 proto2.c = 0;
74 proto2[4294967295] = 0; 76 proto2[4294967295] = 0;
75 proto2.c = 0;
76 proto2[4294967296] = 0;
77 77
78 var proto1 = {}; 78 var proto1 = {};
79 proto1[5] = 0; 79 proto1[5] = 0;
80 proto1.d = 0; 80 proto1.d = 0;
81 proto1[3] = 0; 81 proto1[3] = 0;
82 proto1.e = 0; 82 proto1.e = 0;
83 proto1.f = 0; // also on the 'o' object 83 proto1.f = 0; // also on the 'o' object
84 84
85 var o = {}; 85 var o = {};
86 o[-23] = 0; 86 o[-23] = 0;
87 o[300000000000] = 0; 87 o[300000000000] = 0;
88 o[23] = 0; 88 o[23] = 0;
89 o.f = 0; 89 o.f = 0;
90 o.g = 0; 90 o.g = 0;
91 o[-4] = 0; 91 o[-4] = 0;
92 o[42] = 0; 92 o[42] = 0;
93 93
94 o.__proto__ = proto1; 94 o.__proto__ = proto1;
95 proto1.__proto__ = proto2; 95 proto1.__proto__ = proto2;
96 96
97 var expected = ['23', '42', // indexed from 'o' 97 var expected = ['23', '42', // indexed from 'o'
98 '-23', '300000000000', 'f', 'g', '-4', // named from 'o' 98 '-23', '300000000000', 'f', 'g', '-4', // named from 'o'
99 '3', '5', // indexed from 'proto1' 99 '3', '5', // indexed from 'proto1'
100 'd', 'e', // named from 'proto1' 100 'd', 'e', // named from 'proto1'
101 '2', '140000', '4294967295', // indexed from 'proto2' 101 '2', '140000', '4294967294', // indexed from 'proto2'
102 'a', 'b', 'c', '4294967296']; // named from 'proto2' 102 'a', 'b', 'c', '4294967295']; // named from 'proto2'
103 var actual = []; 103 var actual = [];
104 for (var p in o) actual.push(p); 104 for (var p in o) actual.push(p);
105 assertArrayEquals(expected, actual); 105 assertArrayEquals(expected, actual);
OLDNEW
« no previous file with comments | « test/cctest/test-api-interceptors.cc ('k') | test/mjsunit/es6/indexed-integer-exotics.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698