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


Ignore:
Timestamp:
Jun 16, 2005, 5:57:37 PM (20 years ago)
Author:
ggaren
Message:

Fixed: <rdar://problem/4151759> 'delete' fails on variables declared inside 'eval' statements.

Reviewed by cblu.

  • kjs/context.h: (KJS::ContextImp::codeType): Added code type accessor for execution context objects.
  • kjs/internal.cpp: (ContextImp::ContextImp): Reflects change to ContextImp::codeType.
  • kjs/nodes.cpp: (VarDeclNode::evaluate): Added separate code path for variable declarations inside 'eval' statements.
  • tests/mozilla/expected.html: Updated expected test results to reflect fix.
File:
1 edited

Legend:

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

    r9352 r9404  
    16291629  // We use Internal to bypass all checks in derived objects, e.g. so that
    16301630  // "var location" creates a dynamic property instead of activating window.location.
    1631   variable.put(exec, ident, val, DontDelete | Internal);
    1632 
     1631  if (exec->context().imp()->codeType() == EvalCode) {
     1632      // ECMA 10.2.2
     1633      variable.put(exec, ident, val, Internal);
     1634  } else {
     1635      variable.put(exec, ident, val, DontDelete | Internal);
     1636  }
    16331637  return ident.ustring();
    16341638}
Note: See TracChangeset for help on using the changeset viewer.