blob: 98fad0a4236f35f7ed4f5936225833ce88b6dc28 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../../resources/js-test.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>
</body>
</html>