Fixed usage of NewArgumentsObject for accessor.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
bak@chromium.org 2008-10-23 15:06:31 +00:00
parent d296a22917
commit 69686b1435

View File

@ -382,11 +382,12 @@ Object* Accessors::FunctionGetArguments(Object* object, void*) {
// mirror for the right frame.
const int length = frame->GetProvidedParametersCount();
Handle<JSObject> arguments = Factory::NewArgumentsObject(function, length);
Handle<FixedArray> array = Factory::NewFixedArray(length);
// Copy the parameters to the arguments object.
FixedArray* array = FixedArray::cast(arguments->elements());
ASSERT(array->length() == length);
for (int i = 0; i < length; i++) array->set(i, frame->GetParameter(i));
arguments->set_elements(*array);
// Return the freshly allocated arguments object.
return *arguments;