| Index: test/mjsunit/harmony/toMethod.js
|
| diff --git a/test/mjsunit/harmony/toMethod.js b/test/mjsunit/harmony/toMethod.js
|
| index ad51b2ff3809001d159443c731408c86f3f36902..541e4a4032e4b09418d2e3602ef79d85d79bef24 100644
|
| --- a/test/mjsunit/harmony/toMethod.js
|
| +++ b/test/mjsunit/harmony/toMethod.js
|
| @@ -46,6 +46,30 @@
|
| assertThrows(function() { sFun.call({}, {}); }, TypeError);
|
| function f(){};
|
| assertThrows(function() { f.toMethod(1); }, TypeError);
|
| + try {
|
| + Function.prototype.toMethod.call(null, null);
|
| + assertUnreachable();
|
| + } catch (exception) {
|
| + assertTrue(exception instanceof TypeError);
|
| + assertEquals('Function.prototype.toMethod: home object null ' +
|
| + 'is not an object', exception.message);
|
| + }
|
| + try {
|
| + Function.prototype.toMethod.call(42, null);
|
| + assertUnreachable();
|
| + } catch (exception) {
|
| + assertTrue(exception instanceof TypeError);
|
| + assertEquals('Function.prototype.toMethod: home object null ' +
|
| + 'is not an object', exception.message);
|
| + }
|
| + try {
|
| + Function.prototype.toMethod.call(42, {});
|
| + assertUnreachable();
|
| + } catch (exception) {
|
| + assertTrue(exception instanceof TypeError);
|
| + assertEquals('Function.prototype.toMethod was called on 42, which is a ' +
|
| + 'number and not a function', exception.message);
|
| + }
|
| }());
|
|
|
|
|
|
|