Status: New
Owner: ----

New issue 1798 by [email protected]: TypeError not (properly?) raised
http://code.google.com/p/v8/issues/detail?id=1798

While developing an internal project based on V8/PyV8 I identified a strange behavior in V8. Following the sample html page I used for my test


<html>
<body>
        <script>
        var a = 1;
        alert("alert(a)");
        alert(a);

        alert("alert(doc.nonexistent)");
        alert(doc.nonexistent);

        alert("alert(doc.nonexistent.a)");
        alert(doc.nonexistent.a);
        </script>
</body>
</html>

When the script is executed I can observe this output

[2011-10-29 21:33:42] [Window] Alert Text: alert(a)
[2011-10-29 21:33:42] [Window] Alert Text: 1
[2011-10-29 21:33:42] [Window] Alert Text: alert(doc.nonexistent)
[2011-10-29 21:33:42] [Window] Alert Text: None
[2011-10-29 21:33:42] [Window] Alert Text: alert(doc.nonexistent.a)
Traceback (most recent call last):
[..]
TypeError: TypeError: Cannot read property 'a' of undefined ( @ 10 : 22 ) -> alert(doc.nonexistent.a);

Now I would expect a TypeError exception raised even when trying to referencing doc.nonexistent but I see it does not happen and the alert function simply returns without raising it. Is it the way it should work or is it a bug?

Thanks and regards,
Angelo

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to