http://codereview.chromium.org/6904047/diff/1/test/mjsunit/function-call.js
File test/mjsunit/function-call.js (right):

http://codereview.chromium.org/6904047/diff/1/test/mjsunit/function-call.js#newcode1
test/mjsunit/function-call.js:1: // Copyright 2011 the V8 project
authors. All rights reserved.
Put this file into mjsunit/bugs/bug-<bugnumber>.js
Then move it to regress when we fix the problem.

http://codereview.chromium.org/6904047/diff/1/test/mjsunit/function-call.js#newcode30
test/mjsunit/function-call.js:30: ['Object.prototype.toLocaleString',
Just make this an array of the functions, not strings. I.e., remove the
quotes.

http://codereview.chromium.org/6904047/diff/1/test/mjsunit/function-call.js#newcode37
test/mjsunit/function-call.js:37: 'Function.prototype.toString',
Function.prototype.{call,apply,bind} also throw on more than just null
and undefined. Either include them all, or drop toString - it's not
ToObject that's the cause of the throwing, and the exception message is
likely to be different.
Ditto for other non-generic functions (e.g. String.prototype.toString).

http://codereview.chromium.org/6904047/diff/1/test/mjsunit/function-call.js#newcode143
test/mjsunit/function-call.js:143: 'RegExp.prototype.toString',
All Number, Date and RegExp methods are non-generic, and fails on
everything that's not a Number object or value, a Date object or a
RegExp object, respectively.
It's not about being null or undefined, and it's impossible to tell
whether the TypeError is thrown because the thisValue is null/undefined
or it's the Global object.
I.e., the test doesn't  really test what it's supposed to.
This is a general problem for all non-generic methods. I.e., restrict
the test to only those that use ToObject or CheckObjectCoercible on
this.

http://codereview.chromium.org/6904047/diff/1/test/mjsunit/function-call.js#newcode153
test/mjsunit/function-call.js:153:
eval(should_throw_on_null_and_undefined[i] + '.call(null)');
Check both .call and .apply.
Also consider checking functions that take a callback function and
thisArg (e.g. Array.prototype.{every,some,forEach.map,filter}, and those
taking a callback and always passing undefined as this
(Array.prototype.{reduce,reduceRight}). String.prototype.replace doesn't
specify which "this" object it passes.

http://codereview.chromium.org/6904047/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to