Chromium Code Reviews| Index: test/mjsunit/es6/collections.js |
| diff --git a/test/mjsunit/es6/collections.js b/test/mjsunit/es6/collections.js |
| index 989ded8a3e0fcb342ed632f64c5b9fd8a1521d08..fe95b482a45c39c153a9f408be62ad528c74903c 100644 |
| --- a/test/mjsunit/es6/collections.js |
| +++ b/test/mjsunit/es6/collections.js |
| @@ -51,6 +51,21 @@ function TestValidMapCalls(m) { |
| assertDoesNotThrow(function () { m.set(new Object) }); |
| assertDoesNotThrow(function () { m.has(new Object) }); |
| assertDoesNotThrow(function () { m.delete(new Object) }); |
| + assertDoesNotThrow(function () { m.get(undefined) }); |
|
Dmitry Lomov (no reviews)
2015/03/18 10:55:44
Validate the return value here and below
rossberg
2015/03/18 11:59:24
The actual behaviour ought to be tested further be
|
| + assertDoesNotThrow(function () { m.get(null) }); |
| + assertDoesNotThrow(function () { m.get(0) }); |
| + assertDoesNotThrow(function () { m.get('a-key') }); |
| + assertDoesNotThrow(function () { m.get(Symbol()) }); |
| + assertDoesNotThrow(function () { m.has(undefined) }); |
| + assertDoesNotThrow(function () { m.has(null) }); |
| + assertDoesNotThrow(function () { m.has(0) }); |
| + assertDoesNotThrow(function () { m.has('a-key') }); |
| + assertDoesNotThrow(function () { m.has(Symbol()) }); |
| + assertDoesNotThrow(function () { m.delete(undefined) }); |
| + assertDoesNotThrow(function () { m.delete(null) }); |
| + assertDoesNotThrow(function () { m.delete(0) }); |
| + assertDoesNotThrow(function () { m.delete('a-key') }); |
| + assertDoesNotThrow(function () { m.delete(Symbol()) }); |
| } |
| TestValidMapCalls(new Map); |
| TestValidMapCalls(new WeakMap); |
| @@ -58,14 +73,11 @@ TestValidMapCalls(new WeakMap); |
| // Test invalid getter and setter calls for WeakMap only |
| function TestInvalidCalls(m) { |
| - assertThrows(function () { m.get(undefined) }, TypeError); |
| assertThrows(function () { m.set(undefined, 0) }, TypeError); |
| - assertThrows(function () { m.get(null) }, TypeError); |
| assertThrows(function () { m.set(null, 0) }, TypeError); |
| - assertThrows(function () { m.get(0) }, TypeError); |
| assertThrows(function () { m.set(0, 0) }, TypeError); |
| - assertThrows(function () { m.get('a-key') }, TypeError); |
| assertThrows(function () { m.set('a-key', 0) }, TypeError); |
| + assertThrows(function () { m.set(Symbol(), 0) }, TypeError); |
| } |
| TestInvalidCalls(new WeakMap); |