[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 Feb 15 10:20:21 PST 2012


--- Comment #7 from Oliver Hunt <oliver at apple.com>  2012-02-15 10:20:21 PST ---
(In reply to comment #6)
> if (somethingThatIsTrueInMozillaAndWebKit())
> >     function foo() { somethingThatOnlyWorksInMozilla(); }
> > else
> >     function foo() { somethingThatWorksInIEAndWebKit(); }
> Keeping the existing webkit behavior in the presence of ES6 block-scoped variables is going to be really suprising to developers.
> Can we change things?  We can have FunctionDeclaration still hoist the function and body as before, but add FunctionStatement, with semantics equivalent to var foo = function foo() { ... };.
> I understand there are tradeoffs, of course, but we are in time to make life better for future JS developers, when let is the new var.

There is no problem here, if you use let, we enforce the spec: don't allow function statements nested inside of let statements. 

As let is new syntax we won't be breaking pre-existing code.

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