blob: 179b1f2334ebd9a920653f3b6ca29fc9e39acad0 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that toString() works correctly on NPObject.");
plugin = document.createElement("embed");
plugin.type = "application/x-webkit-test-netscape";
plugin.setAttribute('test', 'to-string-and-value-of-object');
document.body.appendChild(plugin);
shouldBe("plugin[Symbol.toPrimitive]", "undefined");
shouldBeEqualToString("plugin.toString()", "TestObject");
// Normal plugin.testObject + "" will call valueOf,
// do some tricks to make a call to implicit toString.
shouldBeEqualToString("[plugin, ''].join('')", "TestObject");
var successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>