Changeset 21790 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
May 25, 2007, 4:50:00 PM (18 years ago)
Author:
darin
Message:

JavaScriptCore:

Reviewed by Darin.

  • Add a explicit check for arguments. Previously check was done with getDirect, but since the arguments is created on-demand in ActivationImp, it doesn't show up in the test. 'arguments' should always be in the VarDeclNode's evaluation scope.
  • kjs/nodes.cpp: (VarDeclNode::evaluate): Additional check if the var decl identifier is 'arguments'

LayoutTests:

Reviewed by Darin.

  • fast/js/resources/vardecl-preserve-arguments.js: Added.
  • fast/js/vardecl-preserve-arguments-expected.txt: Added.
  • fast/js/vardecl-preserve-arguments.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r21080 r21790  
    15991599      // already declared? - check with getDirect so you can override
    16001600      // built-in properties of the global object with var declarations.
    1601       if (variable->getDirect(ident))
     1601      // Also check for 'arguments' property. The 'arguments' cannot be found with
     1602      // getDirect, because it's created lazily by
     1603      // ActivationImp::getOwnPropertySlot.
     1604      // Since variable declarations are always in function scope, 'variable'
     1605      // will always contain instance of ActivationImp and ActivationImp will
     1606      // always have 'arguments' property
     1607      if (variable->getDirect(ident) || ident == exec->propertyNames().arguments)
    16021608          return 0;
    16031609      val = jsUndefined();
Note: See TracChangeset for help on using the changeset viewer.