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

Side by Side Diff: test/mjsunit/harmony/proxies-for.js

Issue 1544793002: [tests] Fix bogus uses of assertThrows. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 11 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/mjsunit/harmony/proxies.js ('k') | test/mjsunit/harmony/proxies-with.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 // Throw exception in enumerate trap. 109 // Throw exception in enumerate trap.
110 110
111 function TestForInThrow(handler) { 111 function TestForInThrow(handler) {
112 TestWithProxies(TestForInThrow2, handler) 112 TestWithProxies(TestForInThrow2, handler)
113 } 113 }
114 114
115 function TestForInThrow2(create, handler) { 115 function TestForInThrow2(create, handler) {
116 var p = create(handler) 116 var p = create(handler)
117 var o = Object.create(p) 117 var o = Object.create(p)
118 assertThrows(function(){ for (var x in p) {} }, "myexn") 118 assertThrowsEquals(function(){ for (var x in p) {} }, "myexn")
119 assertThrows(function(){ for (var x in o) {} }, "myexn") 119 assertThrowsEquals(function(){ for (var x in o) {} }, "myexn")
120 } 120 }
121 121
122 TestForInThrow({ 122 TestForInThrow({
123 enumerate: function() { throw "myexn" } 123 enumerate: function() { throw "myexn" }
124 }) 124 })
125 125
126 TestForInThrow({ 126 TestForInThrow({
127 enumerate: function() { return this.enumerate2() }, 127 enumerate: function() { return this.enumerate2() },
128 enumerate2: function() { throw "myexn" } 128 enumerate2: function() { throw "myexn" }
129 }) 129 })
(...skipping 10 matching lines...) Expand all
140 o.__proto__ = p; 140 o.__proto__ = p;
141 var keys = []; 141 var keys = [];
142 for (var k in o) { keys.push(k); }; 142 for (var k in o) { keys.push(k); };
143 assertEquals(["0"], keys); 143 assertEquals(["0"], keys);
144 })(); 144 })();
145 145
146 (function () { 146 (function () {
147 var p = new Proxy({}, {ownKeys: function() { return ["1", Symbol(), "2"] }}); 147 var p = new Proxy({}, {ownKeys: function() { return ["1", Symbol(), "2"] }});
148 assertEquals(["1","2"], Object.getOwnPropertyNames(p)); 148 assertEquals(["1","2"], Object.getOwnPropertyNames(p));
149 })(); 149 })();
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/proxies.js ('k') | test/mjsunit/harmony/proxies-with.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698