Index: test/webkit/fast/js/array-slow-put.js |
diff --git a/test/webkit/dfg-arguments-cross-code-origin.js b/test/webkit/fast/js/array-slow-put.js |
similarity index 79% |
copy from test/webkit/dfg-arguments-cross-code-origin.js |
copy to test/webkit/fast/js/array-slow-put.js |
index 0793dfa9acb5dd82d3360b069f384667bdf48281..1e8c44d4ed539cc146bd13f29b82f3fc5f434f43 100644 |
--- a/test/webkit/dfg-arguments-cross-code-origin.js |
+++ b/test/webkit/fast/js/array-slow-put.js |
@@ -22,23 +22,21 @@ |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
description( |
-"Tests uses of 'arguments' that are aliased but span code origins." |
+"Tests that defining a setter on the Array prototype works." |
); |
-function foo() { |
- return arguments; |
-} |
+var ouches = 0; |
+Array.prototype.__defineSetter__("3", function() { debug("Ouch!"); ouches++; }); |
-function bar(a) { |
- var result = 0; |
- for (var i = 0; i < a.length; ++i) |
- result += a[i]; |
+function foo() { |
+ var result = []; |
+ result.length = 5; |
+ for (var i = 0; i < result.length; ++i) |
+ result[i] = i; |
return result; |
} |
-function baz(x) { |
- return bar(foo(x)); |
-} |
+for (var i = 0; i < 100; ++i) |
+ shouldBe("\"" + foo().join(",") + "\"", "\"0,1,2,,4\""); |
-for (var i = 0; i < 200; ++i) |
- shouldBe("baz(42)", "42"); |
+shouldBe("ouches", "100"); |