[Webkit-unassigned] [Bug 18634] New: SQUIRRELFISH: correctly handle variable and function declarations in eval code

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Apr 19 23:16:20 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=18634

           Summary: SQUIRRELFISH: correctly handle variable and function
                    declarations in eval code
           Product: WebKit
           Version: 526+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Keywords: SquirrelFishBlocker
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: cwzwarich at uwaterloo.ca


SquirrelFish currently doesn't correctly handle variable and function
declarations in eval code. The problems are as follows:

1) Variables that are declared in eval code are not initialized to undefined at
the beginning of the eval code block. This affects at least the following
tests, in the simple form of a "var MYVAR;" declaration:

ecma/Expressions/11.3.1.js
ecma/Expressions/11.3.2.js
ecma/Expressions/11.4.4.js
ecma/Expressions/11.4.5.js

2) Variables defined in eval code are always initialized in global scope. This
is a side effect of the above problem. If the first problem was fixed and
undefined was stored in the slot of each new variable, then the code emitted
for AssignResolveNode would find the right base for the variable and update
that object correctly. We need to be careful here that we always use the right
variable object, which is the activation object of the calling function in the
case of direct eval inside of a function body, and the global object otherwise.
We can't just grab the top of the scope chain thanks to 'with', and we no
longer correctly track variable objects in ExecStates, but we should still be
able to determine whether or not we are global code and grab the activation
object of the calling function via callFrame[Machine::OptionalCalleeActivation]
if we are not.

3) Function declarations in eval code don't work at all. I think this will be
easily fixable once we fix the other two problems.


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



More information about the webkit-unassigned mailing list