Class AInterpreter.DebugScope

java.lang.Object
org.htmlunit.corejs.javascript.AInterpreter.DebugScope
All Implemented Interfaces:
Serializable, ConstProperties<VarScope>, PropHolder<VarScope>, VarScope
Enclosing class:
AInterpreter<T extends ACallFrame<T,U>,U extends ACompilerData<?,U>>

protected static class AInterpreter.DebugScope extends Object implements VarScope
This class is intended as proxy to give DebugFrame access to the contents of local variables. We take this approach rather than forcing the interpreter to introduce activation frames because it is faster (assuming local variable manipulation by the interpreter is more common than inspection by the debugger) and it reduces the chance that programs might evexcute differently in debug mode.
See Also:
  • Method Details

    • delete

      public void delete(String name)
      Specified by:
      delete in interface PropHolder<VarScope>
    • delete

      public void delete(int index)
      Specified by:
      delete in interface PropHolder<VarScope>
    • delete

      public void delete(Symbol key)
      Specified by:
      delete in interface PropHolder<VarScope>
    • get

      public Object get(String name, VarScope scope)
      Specified by:
      get in interface PropHolder<VarScope>
    • get

      public Object get(int index, VarScope scope)
      Specified by:
      get in interface PropHolder<VarScope>
    • get

      public Object get(Symbol key, VarScope scope)
      Specified by:
      get in interface PropHolder<VarScope>
    • getIds

      public Object[] getIds()
      Description copied from interface: PropHolder
      Get an array of property ids.

      Not all property ids need be returned. Those properties whose ids are not returned are considered non-enumerable.

      Specified by:
      getIds in interface PropHolder<VarScope>
      Returns:
      an array of Objects. Each entry in the array is either a java.lang.String or a java.lang.Number
    • getParentScope

      public VarScope getParentScope()
      Description copied from interface: VarScope
      Get the parent scope of this scope.
      Specified by:
      getParentScope in interface VarScope
      Returns:
      the parent scope
    • has

      public boolean has(String name, VarScope start)
      Specified by:
      has in interface PropHolder<VarScope>
    • has

      public boolean has(int index, VarScope start)
      Specified by:
      has in interface PropHolder<VarScope>
    • has

      public boolean has(Symbol key, VarScope start)
      Specified by:
      has in interface PropHolder<VarScope>
    • put

      public void put(String name, VarScope start, Object value)
      Specified by:
      put in interface PropHolder<VarScope>
    • put

      public void put(int index, VarScope start, Object value)
      Specified by:
      put in interface PropHolder<VarScope>
    • put

      public void put(Symbol key, VarScope start, Object value)
      Specified by:
      put in interface PropHolder<VarScope>
    • defineConst

      public void defineConst(Context cx, String name, VarScope start)
      Description copied from interface: ConstProperties
      Reserves a definition spot for a const. This will set up a definition of the const property, but set its value to undefined. The semantics of the start parameter is the same as for putConst.
      Specified by:
      defineConst in interface ConstProperties<VarScope>
      name - The name of the property.
      start - The object whose property is being reserved.
    • isConst

      public boolean isConst(Context cx, String name)
      Description copied from interface: ConstProperties
      Returns true if the named property is defined as a const on this object.
      Specified by:
      isConst in interface ConstProperties<VarScope>
      name - the name of the property
      Returns:
      true if the named property is defined as a const, false otherwise.
    • putConst

      public void putConst(Context cx, String name, VarScope start, Object value)
      Description copied from interface: ConstProperties
      Sets a named const property in this object.

      The property is specified by a string name as defined for Scriptable.get.

      The possible values that may be passed in are as defined for Scriptable.get. A class that implements this method may choose to ignore calls to set certain properties, in which case those properties are effectively read-only.

      For properties defined in a prototype chain, use putProperty in ScriptableObject.

      Note that if a property a is defined in the prototype p of an object o, then evaluating o.a = 23 will cause set to be called on the prototype p with o as the start parameter. To preserve JavaScript semantics, it is the Scriptable object's responsibility to modify o.

      This design allows properties to be defined in prototypes and implemented in terms of getters and setters of Java values without consuming slots in each instance.

      The values that may be set are limited to the following:

      • java.lang.Boolean objects
      • java.lang.String objects
      • java.lang.Number objects
      • org.htmlunit.corejs.javascript.Scriptable objects
      • null
      • The value returned by Context.getUndefinedValue()

      Arbitrary Java objects may be wrapped in a Scriptable by first calling Context.toObject. This allows the property of a JavaScript object to contain an arbitrary Java object as a value.

      Note that has will be called by the runtime first before set is called to determine in which object the property is defined. Note that this method is not expected to traverse the prototype chain, which is different from the ECMA [[Put]] operation.

      Specified by:
      putConst in interface ConstProperties<VarScope>
      name - the name of the property
      start - the object whose property is being set
      value - value to set the property to
      See Also: