2008-09-02 Cameron Zwarich <cwzwarich@uwaterloo.ca>
authorcwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2008 02:42:22 +0000 (02:42 +0000)
committercwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Sep 2008 02:42:22 +0000 (02:42 +0000)
        Reviewed by Oliver Hunt.

        Tests for bug 17936: "ASSERTION FAILED: false" (GetterSetterImp::toObject is called)
        <https://bugs.webkit.org/show_bug.cgi?id=17936>

        This bug was fixed by the rewrite of much of the code handling getters
        and setters in r36016, the revision that introduced the polymorphic
        inline cache.

        * fast/js/delete-getters-setters-expected.txt: Added.
        * fast/js/delete-getters-setters.html: Added.
        * fast/js/resources/delete-getters-setters.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@36034 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/js/delete-getters-setters-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/delete-getters-setters.html [new file with mode: 0644]
LayoutTests/fast/js/resources/delete-getters-setters.js [new file with mode: 0644]
SunSpider/resources/sunspider-standalone-driver.js

index a8a6450..73b2dd1 100644 (file)
@@ -1,3 +1,18 @@
+2008-09-02  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
+
+        Reviewed by Oliver Hunt.
+
+        Tests for bug 17936: "ASSERTION FAILED: false" (GetterSetterImp::toObject is called)
+        <https://bugs.webkit.org/show_bug.cgi?id=17936>
+
+        This bug was fixed by the rewrite of much of the code handling getters
+        and setters in r36016, the revision that introduced the polymorphic
+        inline cache.
+
+        * fast/js/delete-getters-setters-expected.txt: Added.
+        * fast/js/delete-getters-setters.html: Added.
+        * fast/js/resources/delete-getters-setters.js: Added.
+
 2008-08-29  Dean Jackson  <dino@apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/LayoutTests/fast/js/delete-getters-setters-expected.txt b/LayoutTests/fast/js/delete-getters-setters-expected.txt
new file mode 100644 (file)
index 0000000..e57ecf2
--- /dev/null
@@ -0,0 +1,25 @@
+This test checks that deletion of properties works properly with getters and setters.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS b1.property threw exception TypeError: Result of expression 'b1' [undefined] is not an object..
+PASS a2.property threw exception TypeError: Result of expression 'a2' [undefined] is not an object..
+PASS b3.property threw exception TypeError: Result of expression 'b3' [undefined] is not an object..
+PASS a4.property threw exception TypeError: Result of expression 'a4' [undefined] is not an object..
+PASS b5.property threw exception TypeError: Result of expression 'b5' [undefined] is not an object..
+PASS a6.property threw exception TypeError: Result of expression 'a6' [undefined] is not an object..
+PASS b7.property threw exception TypeError: Result of expression 'b7' [undefined] is not an object..
+PASS a8.property threw exception TypeError: Result of expression 'a8' [undefined] is not an object..
+PASS o1.b.property threw exception TypeError: Result of expression 'o1.b' [undefined] is not an object..
+PASS o1.a.property threw exception TypeError: Result of expression 'o1.a' [undefined] is not an object..
+PASS o3.b.property threw exception TypeError: Result of expression 'o3.b' [undefined] is not an object..
+PASS o4.a.property threw exception TypeError: Result of expression 'o4.a' [undefined] is not an object..
+PASS o5.b.property threw exception TypeError: Result of expression 'o5.b' [undefined] is not an object..
+PASS o6.a.property threw exception TypeError: Result of expression 'o6.a' [undefined] is not an object..
+PASS o7.b.property threw exception TypeError: Result of expression 'o7.b' [undefined] is not an object..
+PASS o8.a.property threw exception TypeError: Result of expression 'o8.a' [undefined] is not an object..
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/delete-getters-setters.html b/LayoutTests/fast/js/delete-getters-setters.html
new file mode 100644 (file)
index 0000000..af57b33
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/delete-getters-setters.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/resources/delete-getters-setters.js b/LayoutTests/fast/js/resources/delete-getters-setters.js
new file mode 100644 (file)
index 0000000..0c094c6
--- /dev/null
@@ -0,0 +1,101 @@
+description(
+"This test checks that deletion of properties works properly with getters and setters."
+);
+
+b1 = 1;
+this.__defineSetter__("a1", function() {});
+this.__defineSetter__("b1", function() {});
+delete a1;
+shouldThrow("b1.property");
+a2 = 1;
+this.__defineSetter__("a2", function() {});
+this.__defineSetter__("b2", function() {});
+delete b2;
+shouldThrow("a2.property");
+
+b3 = 1;
+this.__defineGetter__("a3", function() {});
+this.__defineGetter__("b3", function() {});
+delete a3;
+shouldThrow("b3.property");
+
+a4 = 1;
+this.__defineGetter__("a4", function() {});
+this.__defineGetter__("b4", function() {});
+delete b4;
+shouldThrow("a4.property");
+
+b5 = 1;
+this.__defineSetter__("a5", function() {});
+this.__defineGetter__("b5", function() {});
+delete a5;
+shouldThrow("b5.property");
+a6 = 1;
+this.__defineSetter__("a6", function() {});
+this.__defineGetter__("b6", function() {});
+delete b6;
+shouldThrow("a6.property");
+
+b7 = 1;
+this.__defineGetter__("a7", function() {});
+this.__defineSetter__("b7", function() {});
+delete a7;
+shouldThrow("b7.property");
+
+a8 = 1;
+this.__defineGetter__("a8", function() {});
+this.__defineSetter__("b8", function() {});
+delete b8;
+shouldThrow("a8.property");
+
+var o1 = { b: 1 };
+o1.__defineSetter__("a", function() {});
+o1.__defineSetter__("b", function() {});
+delete o1.a;
+shouldThrow("o1.b.property");
+
+var o2 = { a: 1 };
+o2.__defineSetter__("a", function() {});
+o2.__defineSetter__("b", function() {});
+delete o2.b;
+shouldThrow("o1.a.property");
+
+var o3 = { b: 1 };
+o3.__defineGetter__("a", function() {});
+o3.__defineGetter__("b", function() {});
+delete o3.a;
+shouldThrow("o3.b.property");
+
+var o4 = { a: 1 };
+o4.__defineGetter__("a", function() {});
+o4.__defineGetter__("b", function() {});
+delete o4.b;
+shouldThrow("o4.a.property");
+
+var o5 = { b: 1 };
+o5.__defineSetter__("a", function() {});
+o5.__defineSetter__("b", function() {});
+delete o5.a;
+shouldThrow("o5.b.property");
+
+var o6 = { a: 1 };
+o6.__defineSetter__("a", function() {});
+o6.__defineSetter__("b", function() {});
+delete o6.b;
+shouldThrow("o6.a.property");
+
+var o7 = { b: 1 };
+o7.__defineGetter__("a", function() {});
+o7.__defineGetter__("b", function() {});
+delete o7.a;
+shouldThrow("o7.b.property");
+
+var o8 = { a: 1 };
+o8.__defineGetter__("a", function() {});
+o8.__defineGetter__("b", function() {});
+delete o8.b;
+shouldThrow("o8.a.property");
+
+var successfullyParsed = true;
index 22aeb61..3f3186d 100644 (file)
@@ -34,7 +34,7 @@ for (var j = 0; j < tests.length; j++) {
     var startTime = new Date;
     load(testName);
     times[j] = new Date() - startTime;
-    gc();
+    // gc();
 }
 
 function recordResults(tests, times)