Index: test/webkit/dfg-inline-arguments-use-from-uninlined-code.js |
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/dfg-inline-arguments-use-from-uninlined-code.js |
similarity index 63% |
copy from test/webkit/concat-while-having-a-bad-time.js |
copy to test/webkit/dfg-inline-arguments-use-from-uninlined-code.js |
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..aca61271c16e107a91ba03adfe205e11cb48cba8 100644 |
--- a/test/webkit/concat-while-having-a-bad-time.js |
+++ b/test/webkit/dfg-inline-arguments-use-from-uninlined-code.js |
@@ -22,10 +22,34 @@ |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
description( |
-"Tests the behavior of Array.prototype.concat while the array is having a bad time due to one of the elements we are concatenating." |
+"This tests that inlining preserves basic function.arguments functionality when said functionality is used from outside of the code where inlining actually happened." |
); |
-Object.defineProperty(Array.prototype, 0, { writable: false }); |
-shouldBe("[42].concat()", "[42]"); |
+function foo() { |
+ return bar.arguments; |
+} |
+function fuzz() { |
+ return baz.arguments; |
+} |
+function bar(a,b,c) { |
+ return foo(a,b,c); |
+} |
+ |
+function baz(a,b,c) { |
+ var array1 = bar(a,b,c); |
+ var array2 = fuzz(a,b,c); |
+ var result = []; |
+ for (var i = 0; i < array1.length; ++i) |
+ result.push(array1[i]); |
+ for (var i = 0; i < array2.length; ++i) |
+ result.push(array2[i]); |
+ return result; |
+} |
+ |
+for (var __i = 0; __i < 200; ++__i) |
+ shouldBe("\"\" + baz(\"a\" + __i, \"b\" + (__i + 1), \"c\" + (__i + 2))", |
+ "\"a" + __i + ",b" + (__i + 1) + ",c" + (__i + 2) + ",a" + __i + ",b" + (__i + 1) + ",c" + (__i + 2) + "\""); |
+ |
+var successfullyParsed = true; |