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

Side by Side Diff: test/mjsunit/third_party/object-keys.js

Issue 193112: Added test suite adapter for es5conform. (Closed)
Patch Set: regression-test Created 11 years, 3 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
« test/es5conform/harness-adapt.js ('K') | « test/es5conform/testcfg.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006 Apple Computer, Inc. All rights reserved. 1 // Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions 4 // modification, are permitted provided that the following conditions
5 // are met: 5 // are met:
6 // 6 //
7 // 1. Redistributions of source code must retain the above copyright 7 // 1. Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // 9 //
10 // 2. Redistributions in binary form must reproduce the above 10 // 2. Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 assertEquals(Object.keys({b:null, a:null}), ['b', 'a']); 42 assertEquals(Object.keys({b:null, a:null}), ['b', 'a']);
43 assertEquals(Object.keys([]), []); 43 assertEquals(Object.keys([]), []);
44 assertEquals(Object.keys([null]), ['0']); 44 assertEquals(Object.keys([null]), ['0']);
45 assertEquals(Object.keys([null,null]), ['0', '1']); 45 assertEquals(Object.keys([null,null]), ['0', '1']);
46 assertEquals(Object.keys([null,null,,,,null]), ['0', '1', '5']); 46 assertEquals(Object.keys([null,null,,,,null]), ['0', '1', '5']);
47 assertEquals(Object.keys({__proto__:{a:null}}), []); 47 assertEquals(Object.keys({__proto__:{a:null}}), []);
48 assertEquals(Object.keys({__proto__:[1,2,3]}), []); 48 assertEquals(Object.keys({__proto__:[1,2,3]}), []);
49 var x = []; 49 var x = [];
50 x.__proto__ = [1, 2, 3]; 50 x.__proto__ = [1, 2, 3];
51 assertEquals(Object.keys(x), []); 51 assertEquals(Object.keys(x), []);
52 assertEquals(Object.keys(function () {}), []);
52 53
53 function argsTest(a, b, c) { 54 function argsTest(a, b, c) {
54 assertEquals([], Object.keys(arguments)); 55 assertEquals([], Object.keys(arguments));
55 } 56 }
56 57
57 argsTest(1, 2, 3); 58 argsTest(1, 2, 3);
58 59
59 var literal = {a: 1, b: 2, c: 3}; 60 var literal = {a: 1, b: 2, c: 3};
60 var keysBefore = Object.keys(literal); 61 var keysBefore = Object.keys(literal);
61 assertEquals(['a', 'b', 'c'], keysBefore); 62 assertEquals(['a', 'b', 'c'], keysBefore);
62 keysBefore[0] = 'x'; 63 keysBefore[0] = 'x';
63 var keysAfter = Object.keys(literal); 64 var keysAfter = Object.keys(literal);
64 assertEquals(['a', 'b', 'c'], keysAfter); 65 assertEquals(['a', 'b', 'c'], keysAfter);
65 assertEquals(['x', 'b', 'c'], keysBefore); 66 assertEquals(['x', 'b', 'c'], keysBefore);
OLDNEW
« test/es5conform/harness-adapt.js ('K') | « test/es5conform/testcfg.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698