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


Ignore:
Timestamp:
Jun 21, 2005, 11:42:30 AM (20 years ago)
Author:
ggaren
Message:
  • fixed <rdar://problem/4155532> 'delete' succeeds on functions
  • fixed <rdar://problem/4155049> javascript function named as "opener" doesn't get called because of window.opener property

Reviewed by cblu.

  • kjs/nodes.cpp: (FuncDeclNode::processFuncDecl): Functions now have DontDelete and Internal attributes set when appropriate.

Test cases:

  • tests/mozilla/expected.html: Updated for one new success.
  • see also test case added in WebCore.
File:
1 edited

Legend:

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

    r9445 r9448  
    27802780  func.put(exec, lengthPropertyName, Number(plen), ReadOnly|DontDelete|DontEnum);
    27812781
    2782   exec->context().imp()->variableObject().put(exec,ident,func);
     2782  if (exec->context().imp()->codeType() == EvalCode) {
     2783    // ECMA 10.2.2
     2784    exec->context().imp()->variableObject().put(exec, ident, func, Internal);
     2785  } else {
     2786    exec->context().imp()->variableObject().put(exec, ident, func, Internal | DontDelete);
     2787  }
    27832788
    27842789  if (body) {
Note: See TracChangeset for help on using the changeset viewer.