Package flash.tools.debugger

Examples of flash.tools.debugger.Value


  {
    String key = value.getTypeName() + " " + op + " " + type; //$NON-NLS-1$ //$NON-NLS-2$
    Boolean retval = m_evalIsAndInstanceofCache.get(key);
    if (retval == null)
    {
      Value typeval = getGlobal(type);
      if (typeval == null)
        retval = Boolean.FALSE;
      else
        retval = new Boolean(ECMA.toBoolean(evalBinaryOp(op, value, typeval)));
      m_evalIsAndInstanceofCache.put(key, retval);
View Full Code Here


    if (!result)
      throw new NoResponseException(timeout);

    DVariable lastBinaryOp = m_manager.lastBinaryOp();
    Value v;
    if (lastBinaryOp != null)
      v = lastBinaryOp.getValue();
    else
      v = DValue.forPrimitive(Value.UNDEFINED);

    if (v.isAttributeSet(ValueAttribute.IS_EXCEPTION))
      throw new PlayerFaultException(new ExceptionFault(v.getValueAsString(), false, v));

    return v;
  }
View Full Code Here

        // As of FP9, the player will also send the "toString()" message
        // of the exception.  But for backward compatibility with older
        // players, we won't assume that that is there.
        String exceptionMessage;
        boolean willExceptionBeCaught = false;
        Value thrown = null;
        if (msg.getRemaining() > 0)
        {
          exceptionMessage = msg.getString();
          if (msg.getRemaining() > 0)
          {
View Full Code Here

   * Returns whether this is not a variable at all, but is instead a representation
   * of a "traits" object.  A "traits" object is the Flash player's way of describing
   * one class.
   */
  private boolean isTraits(DVariable variable) {
    Value value = variable.getValue();
    if (value.getType() == VariableType.UNKNOWN && Value.TRAITS_TYPE_NAME.equals(value.getTypeName())) {
      return true;
    }
    return false;
  }
View Full Code Here

  public boolean hasValueChanged(Session s)
  {
    boolean hasValueChanged = false;
    if (s instanceof PlayerSession)
    {
      Value previousParent = ((PlayerSession)s).getPreviousValue(m_nonProtoParentId);
      if (previousParent != null)
      {
        try {
          Variable previousMember = previousParent.getMemberNamed(null, getName());
          // If the old variable had a getter but never invoked that getter,
          // then it's too late, we don't know the old value.
          if (previousMember instanceof DVariable && !previousMember.needsToInvokeGetter())
          {
            Value previousValue = ((DVariable)previousMember).m_value;
            if (previousValue != null)
            {
              String previousValueAsString = previousValue.getValueAsString();
              if (previousValueAsString != null)
              {
                if (!previousValueAsString.equals(getValue().getValueAsString()))
                {
                  hasValueChanged = true;
View Full Code Here

        int oldInvokeGetters = playerSession.getPreference(SessionManager.PREF_INVOKE_GETTERS);
        playerSession.setPreference(SessionManager.PREF_INVOKE_GETTERS, 1);

        try {
          // fire the getter using the original object id. make sure we get something reasonable back
          Value v = playerSession.getValue(m_nonProtoParentId, getRawName());
          if (v != null)
          {
            m_value = v;
            m_firedGetter = true;
            if (m_value instanceof DValue)
View Full Code Here

        optionalPreferredType = PreferredType.NUMBER;
    }

    if (optionalPreferredType == PreferredType.NUMBER)
    {
      Value result = callValueOf(session, v);
      if (isPrimitive(result))
        return result;
      result = callToString(session, v);
      if (isPrimitive(result))
        return result;
      throw new RuntimeException(new PlayerFaultException(new ExceptionFault(ASTBuilder.getLocalizationManager().getLocalizedTextString("typeError"), false, null))); //$NON-NLS-1$
    }
    else
    {
      Value result = callToString(session, v);
      if (isPrimitive(result))
        return result;
      result = callValueOf(session, v);
      if (isPrimitive(result))
        return result;
View Full Code Here

  /** ECMA 11.8.5.  Returns true, false, or undefined. */
  public static Value lessThan(Session session, Value x, Value y)
  {
    x = safeValue(x);
    y = safeValue(y);
    Value px = toPrimitive(session, x, PreferredType.NUMBER);
    Value py = toPrimitive(session, y, PreferredType.NUMBER);
    if (px.getType() == VariableType.STRING
        && py.getType() == VariableType.STRING)
    {
      String sx = px.getValueAsString();
      String sy = py.getValueAsString();
      return DValue.forPrimitive(new Boolean(sx.compareTo(sy) < 0));
    }
    else
    {
      double dx = toNumber(session, px);
View Full Code Here

      }

      // if the attempt to get the variable's value threw an exception inside the
      // player (most likely because the variable is actually a getter, and the
      // getter threw something), then throw something here
      Value resultValue = null;

      if (result instanceof Variable)
      {
        if (result instanceof VariableFacade && ((VariableFacade)result).getVariable() == null)
          resultValue = null;
        else
          resultValue = ((Variable)result).getValue();
      }
      else if (result instanceof Value)
      {
        resultValue = (Value) result;
      }

      if (resultValue != null)
      {
        if (resultValue.isAttributeSet(ValueAttribute.IS_EXCEPTION))
        {
          String value = resultValue.getValueAsString();
          throw new PlayerFaultException(new ExceptionFault(value, false, resultValue));
        }
      }
    }
    catch(PlayerDebugException pde)
View Full Code Here

  /* returns a string consisting of formatted member names and values */
  public Object lookupMembers(Object o) throws NoSuchVariableException
  {
    Variable var = null;
    Value val = null;
      Variable[] mems = null;
    try
    {
      var = resolveToVariable(o);
      if (var != null)
        val = var.getValue();
      else
        val = resolveToValue(o);
      mems = val.getMembers(getSession());
    }
    catch(NullPointerException npe)
    {
      throw new NoSuchVariableException(o);
    }
    catch(PlayerDebugException pde)
    {
      throw new NoSuchVariableException(o); // not quite right...
    }

      StringBuilder sb = new StringBuilder();

      if (var != null)
        ExpressionCache.appendVariable(sb, var);
      else
        ExpressionCache.appendVariableValue(sb, val);

    boolean attrs = m_cache.propertyEnabled(DebugCLI.DISPLAY_ATTRIBUTES);
    if (attrs && var != null)
      ExpressionCache.appendVariableAttributes(sb, var);

    // [mmorearty] experimenting with hierarchical display of members
    String[] classHierarchy = val.getClassHierarchy(false);
    if (classHierarchy != null && getSession().getPreference(SessionManager.PREF_HIERARCHICAL_VARIABLES) != 0)
    {
      for (int c=0; c<classHierarchy.length; ++c)
      {
        String classname = classHierarchy[c];
View Full Code Here

TOP

Related Classes of flash.tools.debugger.Value

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.