Remove special-case for arguments.toString to match ES5

Patch by Jan de Mooij <jandemooij@gmail.com>
Review: http://codereview.chromium.org/273073

Review URL: http://codereview.chromium.org/389008


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3279 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
christian.plesner.hansen@gmail.com 2009-11-11 11:28:37 +00:00
parent 3445dfe827
commit 5d4d5944dd
2 changed files with 3 additions and 6 deletions

View File

@ -196,10 +196,7 @@ $Object.prototype.constructor = $Object;
// ECMA-262 - 15.2.4.2
function ObjectToString() {
var c = %_ClassOf(this);
// Hide Arguments from the outside.
if (c === 'Arguments') c = 'Object';
return "[object " + c + "]";
return "[object " + %_ClassOf(this) + "]";
}

View File

@ -48,9 +48,9 @@ function F(f) {
assertEquals("[object global]", eval("f()"));
// Receiver should be the arguments object here.
assertEquals("[object Object]", eval("arguments[0]()"));
assertEquals("[object Arguments]", eval("arguments[0]()"));
with (arguments) {
assertEquals("[object Object]", toString());
assertEquals("[object Arguments]", toString());
}
}