Index: test/webkit/fast/js/kde/completion.js |
diff --git a/test/webkit/fast/js/toString-exception.js b/test/webkit/fast/js/kde/completion.js |
similarity index 76% |
copy from test/webkit/fast/js/toString-exception.js |
copy to test/webkit/fast/js/kde/completion.js |
index 2a8b50c0fdd080deeb9a8115a04b9d3680bea08b..f75c98f4010d69f2c290f1e4bb3f0bd31a769815 100644 |
--- a/test/webkit/fast/js/toString-exception.js |
+++ b/test/webkit/fast/js/kde/completion.js |
@@ -21,23 +21,29 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-description( |
-'This test checks for regression against <a href="https://bugs.webkit.org/show_bug.cgi?id=7343">7343: REGRESSION: fast/js/toString-overrides.html fails when run multiple times</a>.' |
-); |
+description("KDE JS Test"); |
+var i = 1; |
-var a = [{ toString : 0 }]; |
- |
-try { |
- a.toString(); |
-} catch (e) { |
+function foo() { |
+ i = 2; |
+ return; |
+ i = 3; |
} |
-var caught = false; |
- |
-try { |
- a.toString(); |
-} catch (e) { |
-caught = true; |
-} |
+shouldBe("foo(), i", "2"); |
+var caught = false; |
+try { eval("return;"); } catch(e) { caught = true; } |
shouldBeTrue("caught"); |
+ |
+// value completions take precedence |
+var val = eval("11; { }"); |
+shouldBe("val", "11"); |
+val = eval("12; ;"); |
+shouldBe("val", "12"); |
+val = eval("13; if(false);"); |
+shouldBe("val", "13"); |
+val = eval("14; function f() {}"); |
+shouldBe("val", "14"); |
+val = eval("15; var v = 0"); |
+shouldBe("val", "15"); |