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

Unified Diff: test/mjsunit/harmony/collections.js

Issue 21400002: Calling Map etc without new should throw TypeError (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/collection.js ('k') | test/mjsunit/harmony/proxies-example-membrane.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/collections.js
diff --git a/test/mjsunit/harmony/collections.js b/test/mjsunit/harmony/collections.js
index 3e87e6b533bdea945ea775e1c625ce8ec912d185..174d3d1dc7ca772c86e388e8de68f786b9022e08 100644
--- a/test/mjsunit/harmony/collections.js
+++ b/test/mjsunit/harmony/collections.js
@@ -207,10 +207,10 @@ TestArbitrary(new WeakMap);
// Test direct constructor call
-assertTrue(Set() instanceof Set);
-assertTrue(Map() instanceof Map);
-assertTrue(WeakMap() instanceof WeakMap);
-assertTrue(WeakSet() instanceof WeakSet);
+assertThrows(function() { Set(); }, TypeError);
+assertThrows(function() { Map(); }, TypeError);
+assertThrows(function() { WeakMap(); }, TypeError);
+assertThrows(function() { WeakSet(); }, TypeError);
// Test whether NaN values as keys are treated correctly.
@@ -308,7 +308,6 @@ TestPrototype(WeakSet);
function TestConstructor(C) {
assertFalse(C === Object.prototype.constructor);
assertSame(C, C.prototype.constructor);
- assertSame(C, C().__proto__.constructor);
assertSame(C, (new C).__proto__.constructor);
}
TestConstructor(Set);
« no previous file with comments | « src/collection.js ('k') | test/mjsunit/harmony/proxies-example-membrane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698