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

Side by Side Diff: test/mjsunit/es6/object-tostring.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/es6/array-tostring.js ('k') | test/mjsunit/harmony/proxies.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-tostring --harmony-proxies 5 // Flags: --harmony-tostring --harmony-proxies
6 6
7 var global = this; 7 var global = this;
8 8
9 var funs = { 9 var funs = {
10 Object: [ Object ], 10 Object: [ Object ],
(...skipping 23 matching lines...) Expand all
34 var obj = {}; 34 var obj = {};
35 obj[Symbol.toStringTag] = className; 35 obj[Symbol.toStringTag] = className;
36 assertEquals("[object " + className + "]", 36 assertEquals("[object " + className + "]",
37 Object.prototype.toString.call(obj)); 37 Object.prototype.toString.call(obj));
38 38
39 // Getter throws 39 // Getter throws
40 obj = {}; 40 obj = {};
41 Object.defineProperty(obj, Symbol.toStringTag, { 41 Object.defineProperty(obj, Symbol.toStringTag, {
42 get: function() { throw className; } 42 get: function() { throw className; }
43 }); 43 });
44 assertThrows(function() { 44 assertThrowsEquals(function() {
45 Object.prototype.toString.call(obj); 45 Object.prototype.toString.call(obj);
46 }, className); 46 }, className);
47 47
48 // Getter does not throw 48 // Getter does not throw
49 obj = {}; 49 obj = {};
50 Object.defineProperty(obj, Symbol.toStringTag, { 50 Object.defineProperty(obj, Symbol.toStringTag, {
51 get: function() { return className; } 51 get: function() { return className; }
52 }); 52 });
53 assertEquals("[object " + className + "]", 53 assertEquals("[object " + className + "]",
54 Object.prototype.toString.call(obj)); 54 Object.prototype.toString.call(obj));
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 assertTag("Function", new Proxy(() => 42, {get() {return 666}})); 152 assertTag("Function", new Proxy(() => 42, {get() {return 666}}));
153 153
154 revocable = Proxy.revocable([], {}); 154 revocable = Proxy.revocable([], {});
155 revocable.revoke(); 155 revocable.revoke();
156 assertThrows(() => Object.prototype.toString.call(revocable.proxy), TypeError); 156 assertThrows(() => Object.prototype.toString.call(revocable.proxy), TypeError);
157 157
158 handler = {}; 158 handler = {};
159 revocable = Proxy.revocable([], handler); 159 revocable = Proxy.revocable([], handler);
160 handler.get = () => revocable.revoke(); 160 handler.get = () => revocable.revoke();
161 assertThrows(() => Object.prototype.toString.call(revocable.proxy), TypeError); 161 assertThrows(() => Object.prototype.toString.call(revocable.proxy), TypeError);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/array-tostring.js ('k') | test/mjsunit/harmony/proxies.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698