RESOLVED FIXED 64424
Our direct eval behaviour deviates slightly from the spec.
https://bugs.webkit.org/show_bug.cgi?id=64424
Summary Our direct eval behaviour deviates slightly from the spec.
Gavin Barraclough
Reported 2011-07-12 19:29:16 PDT
The ES5 spec defines a concept of 'Direct Call to Eval' (see section 15.1.2.1.1), where behaviour will differ from that of an indirect call (e.g. " { eval: window.eval }.eval();" or "var a = eval; a();" are indirect calls), particularly in non-strict scopes variables may be introduced into the caller's environment. ES5 direct calls are any call where the callee function is provided by a reference, a base of that Reference is an EnvironmentRecord (this corresponds to all productions "PrimaryExpression: Identifier", see 10.2.2.1 GetIdentifierReference), and where the name of the reference is "eval". This means any expression of the form "eval(...)", and that calls the standard built in eval method from on the Global Object, is considered to be direct. In JavaScriptCore we are currently overly restrictive. We also check that the EnvironmentRecord that is the base of the reference is the Declaractive Environment Record at the root of the scope chain, corresponding to the Global Object - an "eval(..)" statement that hits a var eval in a nested scope is not considered to be direct. This behaviour does not emanate from the spec, and is incorrect.
Attachments
The patch (10.35 KB, patch)
2011-07-12 23:09 PDT, Gavin Barraclough
oliver: review+
webkit.review.bot: commit-queue-
Archive of layout-test-results from ec2-cr-linux-01 (5.81 MB, application/zip)
2011-07-12 23:37 PDT, WebKit Review Bot
no flags
Gavin Barraclough
Comment 1 2011-07-12 23:09:32 PDT
Created attachment 100631 [details] The patch
WebKit Review Bot
Comment 2 2011-07-12 23:37:00 PDT
Comment on attachment 100631 [details] The patch Attachment 100631 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/9016454 New failing tests: fast/js/eval-keyword-vs-function.html
WebKit Review Bot
Comment 3 2011-07-12 23:37:06 PDT
Created attachment 100634 [details] Archive of layout-test-results from ec2-cr-linux-01 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-01 Port: Chromium Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Gavin Barraclough
Comment 4 2011-07-13 12:02:19 PDT
Fixed in r90938
Note You need to log in before you can comment on or make changes to this bug.