Index: LayoutTests/fast/js/dictionary-string-conversion-exception.html |
diff --git a/LayoutTests/fast/js/dictionary-string-conversion-exception.html b/LayoutTests/fast/js/dictionary-string-conversion-exception.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a1780537dfa1465c95e95aafa6db23aa1b9b166f |
--- /dev/null |
+++ b/LayoutTests/fast/js/dictionary-string-conversion-exception.html |
@@ -0,0 +1,16 @@ |
+<!DOCTYPE HTML> |
+<html> |
+<head> |
+<script src="resources/js-test-pre.js"></script> |
+</head> |
+<body> |
+<script> |
+description("Checks that an exception is thrown when a dictionary value cannot be converted to a String"); |
+shouldBeEqualToString("new MessageEvent('message', {origin: 'test'}).origin", "test"); |
+shouldBeEqualToString("new MessageEvent('message', {origin: 2}).origin", "2"); |
+var nonConvertibleToString = {toString: function() { throw "Exception in toString()"; }}; |
+shouldThrow("new MessageEvent('message', {origin: nonConvertibleToString})", "'Exception in toString()'"); |
+</script> |
+<script src="resources/js-test-post.js"></script> |
+</body> |
+</html> |