| Index: test/mjsunit/function-call.js
|
| diff --git a/test/mjsunit/function-call.js b/test/mjsunit/function-call.js
|
| index 88df353a60c2ae9f96447c0a765af7e40c482229..fb91dcd879640e61cd0034874da9cfe229c1a60b 100644
|
| --- a/test/mjsunit/function-call.js
|
| +++ b/test/mjsunit/function-call.js
|
| @@ -162,13 +162,10 @@ for (var i = 0; i < should_throw_on_null_and_undefined.length; i++) {
|
|
|
| var exception = false;
|
| try {
|
| - // We call all functions with no parameters, which means that essential
|
| - // parameters will have the undefined value.
|
| - // The test for whether the "this" value is null or undefined is always
|
| - // performed before access to the other parameters, so even if the
|
| - // undefined value is an invalid argument value, it mustn't change
|
| - // the result of the test.
|
| - should_throw_on_null_and_undefined[i].call(null);
|
| + // We need to pass a dummy object argument ({}) to these functions because
|
| + // of Object.prototype.isPrototypeOf's special behavior, see issue 3483
|
| + // for more details.
|
| + should_throw_on_null_and_undefined[i].call(null, {});
|
| } catch (e) {
|
| exception = true;
|
| checkExpectedMessage(e);
|
| @@ -177,7 +174,7 @@ for (var i = 0; i < should_throw_on_null_and_undefined.length; i++) {
|
|
|
| exception = false;
|
| try {
|
| - should_throw_on_null_and_undefined[i].call(undefined);
|
| + should_throw_on_null_and_undefined[i].call(undefined, {});
|
| } catch (e) {
|
| exception = true;
|
| checkExpectedMessage(e);
|
| @@ -186,7 +183,7 @@ for (var i = 0; i < should_throw_on_null_and_undefined.length; i++) {
|
|
|
| exception = false;
|
| try {
|
| - should_throw_on_null_and_undefined[i].apply(null);
|
| + should_throw_on_null_and_undefined[i].apply(null, [{}]);
|
| } catch (e) {
|
| exception = true;
|
| checkExpectedMessage(e);
|
| @@ -195,7 +192,7 @@ for (var i = 0; i < should_throw_on_null_and_undefined.length; i++) {
|
|
|
| exception = false;
|
| try {
|
| - should_throw_on_null_and_undefined[i].apply(undefined);
|
| + should_throw_on_null_and_undefined[i].apply(undefined, [{}]);
|
| } catch (e) {
|
| exception = true;
|
| checkExpectedMessage(e);
|
| @@ -248,7 +245,9 @@ for (var i = 0; i < non_generic.length; i++) {
|
|
|
| // Test that we still throw when calling with thisArg null or undefined
|
| // through an array mapping function.
|
| -var array = [1,2,3,4,5];
|
| +// We need to make sure that the elements of `array` are all object values,
|
| +// see issue 3483 for more details.
|
| +var array = [{}, [], new Number, new Map, new WeakSet];
|
| for (var j = 0; j < mapping_functions.length; j++) {
|
| for (var i = 0; i < should_throw_on_null_and_undefined.length; i++) {
|
| exception = false;
|
|
|