[Webkit-unassigned] [Bug 27226] Possibly faulty handling of function statements enclosed in other statements (i.e. block, if, etc). JavaScriptCore test ecma_3/FunExpr/fe-001.js failed.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 1 19:32:05 PDT 2010


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


Daniel Parks <dp+webkit+bugzilla at oxidized.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dp+webkit+bugzilla at oxidized
                   |                            |.org




--- Comment #1 from Daniel Parks <dp+webkit+bugzilla at oxidized.org>  2010-09-01 19:32:05 PST ---
I just ran into this. I find the current behavior very surprising, since it means that

var foo = function () {}

is different than

function foo () {}

Note also that this is not consistent with other variable types — the foo variable is not only added to the scope (like other variables), but it's also initialized (too early).

The current behavior seems very un-JavaScript-like. Functions are otherwise not "special", and this can create very confusing bugs. For example, I recently tried to do the following in a library shared with web workers:

if ( self.document ) {

}

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