Revision: 11323
Author:   [email protected]
Date:     Mon Apr 16 01:12:12 2012
Log:      Fix handling of this in Array.prototype.concat method.

[email protected]
BUG=v8:2080
TEST=test262/15.4.4.4-5-c-i-1

Review URL: https://chromiumcodereview.appspot.com/10095006
http://code.google.com/p/v8/source/detail?r=11323

Modified:
 /branches/bleeding_edge/src/array.js
 /branches/bleeding_edge/test/test262/test262.status

=======================================
--- /branches/bleeding_edge/src/array.js        Mon Feb 20 05:48:24 2012
+++ /branches/bleeding_edge/src/array.js        Mon Apr 16 01:12:12 2012
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2012 the V8 project authors. All rights reserved.
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are
 // met:
@@ -465,15 +465,19 @@
 }


+// Returns an array containing the array elements of the object followed
+// by the array elements of each argument in order. See ECMA-262,
+// section 15.4.4.7.
 function ArrayConcat(arg1) {  // length == 1
   if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) {
     throw MakeTypeError("called_on_null_or_undefined",
                         ["Array.prototype.concat"]);
   }

+  var array = ToObject(this);
   var arg_count = %_ArgumentsLength();
   var arrays = new InternalArray(1 + arg_count);
-  arrays[0] = this;
+  arrays[0] = array;
   for (var i = 0; i < arg_count; i++) {
     arrays[i + 1] = %_Arguments(i);
   }
=======================================
--- /branches/bleeding_edge/test/test262/test262.status Fri Apr 13 09:09:15 2012 +++ /branches/bleeding_edge/test/test262/test262.status Mon Apr 16 01:12:12 2012
@@ -35,7 +35,6 @@

 # Not yet analyzed.
 15.10.4.1-5: FAIL
-15.4.4.4-5-c-i-1: FAIL

 # V8 Bug: http://code.google.com/p/v8/issues/detail?id=691
 11.2.3-3_3: FAIL

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

Reply via email to