chromium/third_party/blink/web_tests/fast/js/dictionary-string-conversion-exception.html

<!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>