Index: test/webkit/dfg-dead-redundant-get-array-length.js |
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/dfg-dead-redundant-get-array-length.js |
similarity index 82% |
copy from test/webkit/concat-while-having-a-bad-time.js |
copy to test/webkit/dfg-dead-redundant-get-array-length.js |
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..b82874ffc33218d978e1a54b8d210164d51f7c8e 100644 |
--- a/test/webkit/concat-while-having-a-bad-time.js |
+++ b/test/webkit/dfg-dead-redundant-get-array-length.js |
@@ -22,10 +22,13 @@ |
// 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." |
+"Tests that having a dead, and redundant, use of array.length doesn't cause compiler crashes." |
); |
-Object.defineProperty(Array.prototype, 0, { writable: false }); |
-shouldBe("[42].concat()", "[42]"); |
- |
+function foo(array) { |
+ var x = array.length; // This is dead. If it wasn't, it would be redundant with the one below. |
+ return array.length; |
+} |
+for (var i = 0; i < 128; ++i) |
+ shouldBe("foo([1, 2, 3])", "3"); |