blob: 45179ad71035459df7b9697cb5bb5257d2dd82ed [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("Test converting strings and integers to identifiers and back")
embed = document.createElement("embed");
embed.type = "application/x-webkit-test-netscape";
document.body.appendChild(embed);
shouldBeEqualToString("embed.testIdentifierToString('foo')", "foo");
shouldBeEqualToString("embed.testIdentifierToString('123')", "123");
shouldBeEqualToString("embed.testIdentifierToString('null')", "null");
shouldBe("embed.testIdentifierToString(1)", "undefined");
shouldBe("embed.testIdentifierToString(-1)", "undefined");
shouldBe("embed.testIdentifierToString(1.40)", "undefined");
shouldBe("embed.testIdentifierToInt(1)", "1");
shouldBe("embed.testIdentifierToInt(-1)", "-1");
shouldBe("embed.testIdentifierToInt(10)", "10");
shouldBe("embed.testIdentifierToInt(10.234234)", "10");
shouldBe("embed.testIdentifierToInt('foo')", "0");
shouldBe("embed.testIdentifierToInt('10')", "0");
var successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>