Index: src/mirror-debugger.js |
diff --git a/src/mirror-debugger.js b/src/mirror-debugger.js |
index 999252d57f5f4f604497ff3992ec8259a95392f3..0944b719f124c7c63f57c1fa5a1eb85a88f28316 100644 |
--- a/src/mirror-debugger.js |
+++ b/src/mirror-debugger.js |
@@ -225,7 +225,7 @@ ScopeType = { Global: 0, |
*/ |
function Mirror(type) { |
this.type_ = type; |
-}; |
+} |
Mirror.prototype.type = function() { |
@@ -239,7 +239,7 @@ Mirror.prototype.type = function() { |
*/ |
Mirror.prototype.isValue = function() { |
return this instanceof ValueMirror; |
-} |
+}; |
/** |
@@ -248,7 +248,7 @@ Mirror.prototype.isValue = function() { |
*/ |
Mirror.prototype.isUndefined = function() { |
return this instanceof UndefinedMirror; |
-} |
+}; |
/** |
@@ -257,7 +257,7 @@ Mirror.prototype.isUndefined = function() { |
*/ |
Mirror.prototype.isNull = function() { |
return this instanceof NullMirror; |
-} |
+}; |
/** |
@@ -266,7 +266,7 @@ Mirror.prototype.isNull = function() { |
*/ |
Mirror.prototype.isBoolean = function() { |
return this instanceof BooleanMirror; |
-} |
+}; |
/** |
@@ -275,7 +275,7 @@ Mirror.prototype.isBoolean = function() { |
*/ |
Mirror.prototype.isNumber = function() { |
return this instanceof NumberMirror; |
-} |
+}; |
/** |
@@ -284,7 +284,7 @@ Mirror.prototype.isNumber = function() { |
*/ |
Mirror.prototype.isString = function() { |
return this instanceof StringMirror; |
-} |
+}; |
/** |
@@ -293,7 +293,7 @@ Mirror.prototype.isString = function() { |
*/ |
Mirror.prototype.isObject = function() { |
return this instanceof ObjectMirror; |
-} |
+}; |
/** |
@@ -302,7 +302,7 @@ Mirror.prototype.isObject = function() { |
*/ |
Mirror.prototype.isFunction = function() { |
return this instanceof FunctionMirror; |
-} |
+}; |
/** |
@@ -311,7 +311,7 @@ Mirror.prototype.isFunction = function() { |
*/ |
Mirror.prototype.isUnresolvedFunction = function() { |
return this instanceof UnresolvedFunctionMirror; |
-} |
+}; |
/** |
@@ -320,7 +320,7 @@ Mirror.prototype.isUnresolvedFunction = function() { |
*/ |
Mirror.prototype.isArray = function() { |
return this instanceof ArrayMirror; |
-} |
+}; |
/** |
@@ -329,7 +329,7 @@ Mirror.prototype.isArray = function() { |
*/ |
Mirror.prototype.isDate = function() { |
return this instanceof DateMirror; |
-} |
+}; |
/** |
@@ -338,7 +338,7 @@ Mirror.prototype.isDate = function() { |
*/ |
Mirror.prototype.isRegExp = function() { |
return this instanceof RegExpMirror; |
-} |
+}; |
/** |
@@ -347,7 +347,7 @@ Mirror.prototype.isRegExp = function() { |
*/ |
Mirror.prototype.isError = function() { |
return this instanceof ErrorMirror; |
-} |
+}; |
/** |
@@ -356,7 +356,7 @@ Mirror.prototype.isError = function() { |
*/ |
Mirror.prototype.isProperty = function() { |
return this instanceof PropertyMirror; |
-} |
+}; |
/** |
@@ -365,7 +365,7 @@ Mirror.prototype.isProperty = function() { |
*/ |
Mirror.prototype.isFrame = function() { |
return this instanceof FrameMirror; |
-} |
+}; |
/** |
@@ -374,7 +374,7 @@ Mirror.prototype.isFrame = function() { |
*/ |
Mirror.prototype.isScript = function() { |
return this instanceof ScriptMirror; |
-} |
+}; |
/** |
@@ -383,7 +383,7 @@ Mirror.prototype.isScript = function() { |
*/ |
Mirror.prototype.isContext = function() { |
return this instanceof ContextMirror; |
-} |
+}; |
/** |
@@ -392,7 +392,7 @@ Mirror.prototype.isContext = function() { |
*/ |
Mirror.prototype.isScope = function() { |
return this instanceof ScopeMirror; |
-} |
+}; |
/** |
@@ -400,7 +400,7 @@ Mirror.prototype.isScope = function() { |
*/ |
Mirror.prototype.allocateHandle_ = function() { |
this.handle_ = next_handle_++; |
-} |
+}; |
/** |
@@ -409,13 +409,13 @@ Mirror.prototype.allocateHandle_ = function() { |
*/ |
Mirror.prototype.allocateTransientHandle_ = function() { |
this.handle_ = next_transient_handle_--; |
-} |
+}; |
Mirror.prototype.toText = function() { |
// Simpel to text which is used when on specialization in subclass. |
return "#<" + this.constructor.name + ">"; |
-} |
+}; |
/** |
@@ -480,7 +480,7 @@ inherits(UndefinedMirror, ValueMirror); |
UndefinedMirror.prototype.toText = function() { |
return 'undefined'; |
-} |
+}; |
/** |
@@ -496,7 +496,7 @@ inherits(NullMirror, ValueMirror); |
NullMirror.prototype.toText = function() { |
return 'null'; |
-} |
+}; |
/** |
@@ -513,7 +513,7 @@ inherits(BooleanMirror, ValueMirror); |
BooleanMirror.prototype.toText = function() { |
return this.value_ ? 'true' : 'false'; |
-} |
+}; |
/** |
@@ -530,7 +530,7 @@ inherits(NumberMirror, ValueMirror); |
NumberMirror.prototype.toText = function() { |
return %NumberToString(this.value_); |
-} |
+}; |
/** |
@@ -555,11 +555,11 @@ StringMirror.prototype.getTruncatedValue = function(maxLength) { |
'... (length: ' + this.length() + ')'; |
} |
return this.value_; |
-} |
+}; |
StringMirror.prototype.toText = function() { |
return this.getTruncatedValue(kMaxProtocolStringLength); |
-} |
+}; |
/** |
@@ -898,7 +898,7 @@ FunctionMirror.prototype.constructedBy = function(opt_max_instances) { |
FunctionMirror.prototype.toText = function() { |
return this.source(); |
-} |
+}; |
/** |
@@ -951,7 +951,7 @@ UnresolvedFunctionMirror.prototype.inferredName = function() { |
UnresolvedFunctionMirror.prototype.propertyNames = function(kind, limit) { |
return []; |
-} |
+}; |
/** |
@@ -971,7 +971,8 @@ ArrayMirror.prototype.length = function() { |
}; |
-ArrayMirror.prototype.indexedPropertiesFromRange = function(opt_from_index, opt_to_index) { |
+ArrayMirror.prototype.indexedPropertiesFromRange = function(opt_from_index, |
+ opt_to_index) { |
var from_index = opt_from_index || 0; |
var to_index = opt_to_index || this.length() - 1; |
if (from_index > to_index) return new Array(); |
@@ -987,7 +988,7 @@ ArrayMirror.prototype.indexedPropertiesFromRange = function(opt_from_index, opt_ |
values[i - from_index] = value; |
} |
return values; |
-} |
+}; |
/** |
@@ -1005,7 +1006,7 @@ inherits(DateMirror, ObjectMirror); |
DateMirror.prototype.toText = function() { |
var s = JSON.stringify(this.value_); |
return s.substring(1, s.length - 1); // cut quotes |
-} |
+}; |
/** |
@@ -1059,7 +1060,7 @@ RegExpMirror.prototype.multiline = function() { |
RegExpMirror.prototype.toText = function() { |
// Simpel to text which is used when on specialization in subclass. |
return "/" + this.source() + "/"; |
-} |
+}; |
/** |
@@ -1092,7 +1093,7 @@ ErrorMirror.prototype.toText = function() { |
str = '#<Error>'; |
} |
return str; |
-} |
+}; |
/** |
@@ -1110,7 +1111,7 @@ function PropertyMirror(mirror, name, details) { |
this.value_ = details[0]; |
this.details_ = details[1]; |
if (details.length > 2) { |
- this.exception_ = details[2] |
+ this.exception_ = details[2]; |
this.getter_ = details[3]; |
this.setter_ = details[4]; |
} |
@@ -1120,22 +1121,22 @@ inherits(PropertyMirror, Mirror); |
PropertyMirror.prototype.isReadOnly = function() { |
return (this.attributes() & PropertyAttribute.ReadOnly) != 0; |
-} |
+}; |
PropertyMirror.prototype.isEnum = function() { |
return (this.attributes() & PropertyAttribute.DontEnum) == 0; |
-} |
+}; |
PropertyMirror.prototype.canDelete = function() { |
return (this.attributes() & PropertyAttribute.DontDelete) == 0; |
-} |
+}; |
PropertyMirror.prototype.name = function() { |
return this.name_; |
-} |
+}; |
PropertyMirror.prototype.isIndexed = function() { |
@@ -1145,12 +1146,12 @@ PropertyMirror.prototype.isIndexed = function() { |
} |
} |
return true; |
-} |
+}; |
PropertyMirror.prototype.value = function() { |
return MakeMirror(this.value_, false); |
-} |
+}; |
/** |
@@ -1159,22 +1160,22 @@ PropertyMirror.prototype.value = function() { |
*/ |
PropertyMirror.prototype.isException = function() { |
return this.exception_ ? true : false; |
-} |
+}; |
PropertyMirror.prototype.attributes = function() { |
return %DebugPropertyAttributesFromDetails(this.details_); |
-} |
+}; |
PropertyMirror.prototype.propertyType = function() { |
return %DebugPropertyTypeFromDetails(this.details_); |
-} |
+}; |
PropertyMirror.prototype.insertionIndex = function() { |
return %DebugPropertyIndexFromDetails(this.details_); |
-} |
+}; |
/** |
@@ -1183,7 +1184,7 @@ PropertyMirror.prototype.insertionIndex = function() { |
*/ |
PropertyMirror.prototype.hasGetter = function() { |
return this.getter_ ? true : false; |
-} |
+}; |
/** |
@@ -1192,7 +1193,7 @@ PropertyMirror.prototype.hasGetter = function() { |
*/ |
PropertyMirror.prototype.hasSetter = function() { |
return this.setter_ ? true : false; |
-} |
+}; |
/** |
@@ -1206,7 +1207,7 @@ PropertyMirror.prototype.getter = function() { |
} else { |
return GetUndefinedMirror(); |
} |
-} |
+}; |
/** |
@@ -1220,7 +1221,7 @@ PropertyMirror.prototype.setter = function() { |
} else { |
return GetUndefinedMirror(); |
} |
-} |
+}; |
/** |
@@ -1233,7 +1234,7 @@ PropertyMirror.prototype.isNative = function() { |
return (this.propertyType() == PropertyType.Interceptor) || |
((this.propertyType() == PropertyType.Callbacks) && |
!this.hasGetter() && !this.hasSetter()); |
-} |
+}; |
const kFrameDetailsFrameIdIndex = 0; |
@@ -1284,63 +1285,63 @@ function FrameDetails(break_id, index) { |
FrameDetails.prototype.frameId = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kFrameDetailsFrameIdIndex]; |
-} |
+}; |
FrameDetails.prototype.receiver = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kFrameDetailsReceiverIndex]; |
-} |
+}; |
FrameDetails.prototype.func = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kFrameDetailsFunctionIndex]; |
-} |
+}; |
FrameDetails.prototype.isConstructCall = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kFrameDetailsConstructCallIndex]; |
-} |
+}; |
FrameDetails.prototype.isAtReturn = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kFrameDetailsAtReturnIndex]; |
-} |
+}; |
FrameDetails.prototype.isDebuggerFrame = function() { |
%CheckExecutionState(this.break_id_); |
var f = kFrameDetailsFlagDebuggerFrameMask; |
return (this.details_[kFrameDetailsFlagsIndex] & f) == f; |
-} |
+}; |
FrameDetails.prototype.isOptimizedFrame = function() { |
%CheckExecutionState(this.break_id_); |
var f = kFrameDetailsFlagOptimizedFrameMask; |
return (this.details_[kFrameDetailsFlagsIndex] & f) == f; |
-} |
+}; |
FrameDetails.prototype.isInlinedFrame = function() { |
return this.inlinedFrameIndex() > 0; |
-} |
+}; |
FrameDetails.prototype.inlinedFrameIndex = function() { |
%CheckExecutionState(this.break_id_); |
var f = kFrameDetailsFlagInlinedFrameIndexMask; |
- return (this.details_[kFrameDetailsFlagsIndex] & f) >> 2 |
-} |
+ return (this.details_[kFrameDetailsFlagsIndex] & f) >> 2; |
+}; |
FrameDetails.prototype.argumentCount = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kFrameDetailsArgumentCountIndex]; |
-} |
+}; |
FrameDetails.prototype.argumentName = function(index) { |
@@ -1348,9 +1349,9 @@ FrameDetails.prototype.argumentName = function(index) { |
if (index >= 0 && index < this.argumentCount()) { |
return this.details_[kFrameDetailsFirstDynamicIndex + |
index * kFrameDetailsNameValueSize + |
- kFrameDetailsNameIndex] |
+ kFrameDetailsNameIndex]; |
} |
-} |
+}; |
FrameDetails.prototype.argumentValue = function(index) { |
@@ -1358,45 +1359,45 @@ FrameDetails.prototype.argumentValue = function(index) { |
if (index >= 0 && index < this.argumentCount()) { |
return this.details_[kFrameDetailsFirstDynamicIndex + |
index * kFrameDetailsNameValueSize + |
- kFrameDetailsValueIndex] |
+ kFrameDetailsValueIndex]; |
} |
-} |
+}; |
FrameDetails.prototype.localCount = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kFrameDetailsLocalCountIndex]; |
-} |
+}; |
FrameDetails.prototype.sourcePosition = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kFrameDetailsSourcePositionIndex]; |
-} |
+}; |
FrameDetails.prototype.localName = function(index) { |
%CheckExecutionState(this.break_id_); |
if (index >= 0 && index < this.localCount()) { |
var locals_offset = kFrameDetailsFirstDynamicIndex + |
- this.argumentCount() * kFrameDetailsNameValueSize |
+ this.argumentCount() * kFrameDetailsNameValueSize; |
return this.details_[locals_offset + |
index * kFrameDetailsNameValueSize + |
- kFrameDetailsNameIndex] |
+ kFrameDetailsNameIndex]; |
} |
-} |
+}; |
FrameDetails.prototype.localValue = function(index) { |
%CheckExecutionState(this.break_id_); |
if (index >= 0 && index < this.localCount()) { |
var locals_offset = kFrameDetailsFirstDynamicIndex + |
- this.argumentCount() * kFrameDetailsNameValueSize |
+ this.argumentCount() * kFrameDetailsNameValueSize; |
return this.details_[locals_offset + |
index * kFrameDetailsNameValueSize + |
- kFrameDetailsValueIndex] |
+ kFrameDetailsValueIndex]; |
} |
-} |
+}; |
FrameDetails.prototype.returnValue = function() { |
@@ -1407,12 +1408,12 @@ FrameDetails.prototype.returnValue = function() { |
if (this.details_[kFrameDetailsAtReturnIndex]) { |
return this.details_[return_value_offset]; |
} |
-} |
+}; |
FrameDetails.prototype.scopeCount = function() { |
return %GetScopeCount(this.break_id_, this.frameId()); |
-} |
+}; |
/** |
@@ -1575,7 +1576,8 @@ FrameMirror.prototype.scope = function(index) { |
}; |
-FrameMirror.prototype.evaluate = function(source, disable_break, opt_context_object) { |
+FrameMirror.prototype.evaluate = function(source, disable_break, |
+ opt_context_object) { |
var result = %DebugEvaluate(this.break_id_, |
this.details_.frameId(), |
this.details_.inlinedFrameIndex(), |
@@ -1599,7 +1601,8 @@ FrameMirror.prototype.invocationText = function() { |
result += '[debugger]'; |
} else { |
// If the receiver has a className which is 'global' don't display it. |
- var display_receiver = !receiver.className || receiver.className() != 'global'; |
+ var display_receiver = |
+ !receiver.className || (receiver.className() != 'global'); |
if (display_receiver) { |
result += receiver.toText(); |
} |
@@ -1661,7 +1664,7 @@ FrameMirror.prototype.invocationText = function() { |
} |
return result; |
-} |
+}; |
FrameMirror.prototype.sourceAndPositionText = function() { |
@@ -1693,13 +1696,13 @@ FrameMirror.prototype.sourceAndPositionText = function() { |
} |
return result; |
-} |
+}; |
FrameMirror.prototype.localsText = function() { |
// Format local variables. |
var result = ''; |
- var locals_count = this.localCount() |
+ var locals_count = this.localCount(); |
if (locals_count > 0) { |
for (var i = 0; i < locals_count; ++i) { |
result += ' var '; |
@@ -1711,7 +1714,7 @@ FrameMirror.prototype.localsText = function() { |
} |
return result; |
-} |
+}; |
FrameMirror.prototype.toText = function(opt_locals) { |
@@ -1726,7 +1729,7 @@ FrameMirror.prototype.toText = function(opt_locals) { |
result += this.localsText(); |
} |
return result; |
-} |
+}; |
const kScopeDetailsTypeIndex = 0; |
@@ -1744,13 +1747,13 @@ function ScopeDetails(frame, index) { |
ScopeDetails.prototype.type = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kScopeDetailsTypeIndex]; |
-} |
+}; |
ScopeDetails.prototype.object = function() { |
%CheckExecutionState(this.break_id_); |
return this.details_[kScopeDetailsObjectIndex]; |
-} |
+}; |
/** |
@@ -1862,12 +1865,12 @@ ScriptMirror.prototype.lineCount = function() { |
ScriptMirror.prototype.locationFromPosition = function( |
position, include_resource_offset) { |
return this.script_.locationFromPosition(position, include_resource_offset); |
-} |
+}; |
ScriptMirror.prototype.sourceSlice = function (opt_from_line, opt_to_line) { |
return this.script_.sourceSlice(opt_from_line, opt_to_line); |
-} |
+}; |
ScriptMirror.prototype.context = function() { |
@@ -1907,7 +1910,7 @@ ScriptMirror.prototype.toText = function() { |
} |
result += ')'; |
return result; |
-} |
+}; |
/** |
@@ -1965,7 +1968,7 @@ function JSONProtocolSerializer(details, options) { |
*/ |
JSONProtocolSerializer.prototype.serializeReference = function(mirror) { |
return this.serialize_(mirror, true, true); |
-} |
+}; |
/** |
@@ -1978,7 +1981,7 @@ JSONProtocolSerializer.prototype.serializeReference = function(mirror) { |
JSONProtocolSerializer.prototype.serializeValue = function(mirror) { |
var json = this.serialize_(mirror, false, true); |
return json; |
-} |
+}; |
/** |
@@ -2000,17 +2003,17 @@ JSONProtocolSerializer.prototype.serializeReferencedObjects = function() { |
} |
return content; |
-} |
+}; |
JSONProtocolSerializer.prototype.includeSource_ = function() { |
return this.options_ && this.options_.includeSource; |
-} |
+}; |
JSONProtocolSerializer.prototype.inlineRefs_ = function() { |
return this.options_ && this.options_.inlineRefs; |
-} |
+}; |
JSONProtocolSerializer.prototype.maxStringLength_ = function() { |
@@ -2019,7 +2022,7 @@ JSONProtocolSerializer.prototype.maxStringLength_ = function() { |
return kMaxProtocolStringLength; |
} |
return this.options_.maxStringLength; |
-} |
+}; |
JSONProtocolSerializer.prototype.add_ = function(mirror) { |
@@ -2032,7 +2035,7 @@ JSONProtocolSerializer.prototype.add_ = function(mirror) { |
// Add the mirror to the list of mirrors to be serialized. |
this.mirrors_.push(mirror); |
-} |
+}; |
/** |
@@ -2139,7 +2142,7 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference, |
break; |
case PROPERTY_TYPE: |
- throw new Error('PropertyMirror cannot be serialized independeltly') |
+ throw new Error('PropertyMirror cannot be serialized independeltly'); |
break; |
case FRAME_TYPE: |
@@ -2179,7 +2182,7 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference, |
mirror.evalFromScript()) { |
content.evalFromScript = |
this.serializeReference(mirror.evalFromScript()); |
- var evalFromLocation = mirror.evalFromLocation() |
+ var evalFromLocation = mirror.evalFromLocation(); |
if (evalFromLocation) { |
content.evalFromLocation = { line: evalFromLocation.line, |
column: evalFromLocation.column }; |
@@ -2203,7 +2206,7 @@ JSONProtocolSerializer.prototype.serialize_ = function(mirror, reference, |
// Create and return the JSON string. |
return content; |
-} |
+}; |
/** |
@@ -2278,7 +2281,7 @@ JSONProtocolSerializer.prototype.serializeObject_ = function(mirror, content, |
} |
} |
content.properties = p; |
-} |
+}; |
/** |
@@ -2342,7 +2345,7 @@ JSONProtocolSerializer.prototype.serializeProperty_ = function(propertyMirror) { |
result.ref = propertyValue.handle(); |
} |
return result; |
-} |
+}; |
JSONProtocolSerializer.prototype.serializeFrame_ = function(mirror, content) { |
@@ -2362,7 +2365,7 @@ JSONProtocolSerializer.prototype.serializeFrame_ = function(mirror, content) { |
var x = new Array(mirror.argumentCount()); |
for (var i = 0; i < mirror.argumentCount(); i++) { |
var arg = {}; |
- var argument_name = mirror.argumentName(i) |
+ var argument_name = mirror.argumentName(i); |
if (argument_name) { |
arg.name = argument_name; |
} |
@@ -2392,7 +2395,7 @@ JSONProtocolSerializer.prototype.serializeFrame_ = function(mirror, content) { |
index: i |
}); |
} |
-} |
+}; |
JSONProtocolSerializer.prototype.serializeScope_ = function(mirror, content) { |
@@ -2402,7 +2405,7 @@ JSONProtocolSerializer.prototype.serializeScope_ = function(mirror, content) { |
content.object = this.inlineRefs_() ? |
this.serializeValue(mirror.scopeObject()) : |
this.serializeReference(mirror.scopeObject()); |
-} |
+}; |
/** |