From 5d4d5944dd7b8ed137e51016535e20bc07ce9fe1 Mon Sep 17 00:00:00 2001 From: "christian.plesner.hansen@gmail.com" Date: Wed, 11 Nov 2009 11:28:37 +0000 Subject: [PATCH] Remove special-case for arguments.toString to match ES5 Patch by Jan de Mooij 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 --- src/v8natives.js | 5 +---- test/mjsunit/regress/regress-124.js | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/v8natives.js b/src/v8natives.js index 2fecee80c0..8ba6a8e748 100644 --- a/src/v8natives.js +++ b/src/v8natives.js @@ -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) + "]"; } diff --git a/test/mjsunit/regress/regress-124.js b/test/mjsunit/regress/regress-124.js index 81526b0edd..0b3aae5358 100644 --- a/test/mjsunit/regress/regress-124.js +++ b/test/mjsunit/regress/regress-124.js @@ -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()); } }