[Webkit-unassigned] [Bug 48123] Do not initialize to undefined variables with an initializer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Oct 23 12:16:08 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=48123


Oliver Hunt <oliver at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #71550|review?                     |review-
               Flag|                            |




--- Comment #2 from Oliver Hunt <oliver at apple.com>  2010-10-23 12:16:08 PST ---
(From update of attachment 71550)
This isn't actually safe, as you need control flow analysis to know whether the variable will be accessed prior to initialisation:
<script>
alert(x);
var x = 5;
</script>

x is used prior to be defined but it is not initialised until later.  You also can't hoist the initialiser as it may depend on prior computation, eg.

y=10; 
var x=y;

etc.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list