public NodeThreadContext(JObject frame, DebuggedProcess proc)
        {
            jObject = frame;

            index = (int)frame["index"];
            func = new NodeFunc(proc.LookupRef(frame["func"]));
            script = proc.JsonToScript(proc.LookupRef(frame["script"]));
            line = (int)frame["line"];
            column = (int)frame["column"];

            Args = frame["arguments"].Select(x => new Property((JObject)x, proc)).ToArray();
            Locals = frame["locals"].Select(x => new Property((JObject)x, proc)).ToArray();
        }
Esempio n. 2
0
 private void FillValue(JObject val)
 {
     m_valueHandle = (int)(val["ref"] ?? val["handle"]);
     m_typeName = (string)val["type"];
     switch (m_typeName) {
         case "object":
             m_value = (string)val["text"];
             break;
         case "null":
         case "undefined":
             m_value = m_typeName;
             break;
         case "number":
         case "boolean":
             m_value = JsonConvert.SerializeObject(val["value"]);
             break;
         case "string":
             m_fullString = (string)val["value"];
             // fetch displayed text:
             m_value = JsonConvert.SerializeObject((string)(val["text"] ?? val["value"]));
             DetectStringLength(m_fullString, val);
             break;
         case "function":
             m_value = new NodeFunc(val).AnyName;
             break;
         case "regexp":
             m_value = (string)val["text"];
             break;
         default:
             throw new NotImplementedException("VariableInformation(" + m_typeName);
         //break;
     }
 }
Esempio n. 3
0
 private void FillValue(JObject val)
 {
     m_valueHandle = (int)(val["ref"] ?? val["handle"]);
     m_typeName = (string)val["type"];
     switch (m_typeName) {
         case "object":
             m_value = (string)val["text"] ?? ("#<" + (string)val["className"] + ">");
             m_className = (string)val["className"];
             if (m_value == null && m_className != null)
                 m_value = "#<" + m_className + ">";
             break;
         case "null":
         case "undefined":
             m_value = m_typeName;
             break;
         case "number":
         case "boolean":
             m_value = ((string)val["text"]) ?? JsonConvert.SerializeObject(val["value"]);
             break;
         case "string":
             m_fullString = (string)val["value"];
             // fetch displayed text:
             m_value = JsonConvert.SerializeObject((string)(val["text"] ?? val["value"]));
             DetectStringLength(m_fullString, val);
             break;
         case "function":
             m_value = new NodeFunc(val).AnyName;
             break;
         case "regexp":
             m_value = (string)val["text"];
             foreach (var x in GetChildren()) {
                 if (x.m_name == "global" && x.m_value == "true")
                     m_value += "g";
                 if (x.m_name == "ignoreCase" && x.m_value == "true")
                     m_value += "i";
                 if (x.m_name == "multiline" && x.m_value == "true")
                     m_value += "m";
             }
             break;
         default:
             throw new NotImplementedException("VariableInformation(" + m_typeName);
         //break;
     }
 }