| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 return { | 120 return { |
| 121 scriptId: "" + script.id(), | 121 scriptId: "" + script.id(), |
| 122 lineNumber: location.line, | 122 lineNumber: location.line, |
| 123 columnNumber: location.column | 123 columnNumber: location.column |
| 124 }; | 124 }; |
| 125 } | 125 } |
| 126 return null; | 126 return null; |
| 127 } | 127 } |
| 128 | 128 |
| 129 /** | 129 /** |
| 130 * @param {Object} object | |
| 131 * @return {!Array<!{value: *}>|undefined} | |
| 132 */ | |
| 133 DebuggerScript.getCollectionEntries = function(object) | |
| 134 { | |
| 135 var mirror = MakeMirror(object); | |
| 136 if (mirror.isMap()) | |
| 137 return /** @type {!MapMirror} */(mirror).entries(); | |
| 138 if (mirror.isSet() || mirror.isIterator()) { | |
| 139 var result = []; | |
| 140 var values = mirror.isSet() ? /** @type {!SetMirror} */(mirror).values()
: /** @type {!IteratorMirror} */(mirror).preview(); | |
| 141 for (var i = 0; i < values.length; ++i) | |
| 142 result.push({ value: values[i] }); | |
| 143 return result; | |
| 144 } | |
| 145 } | |
| 146 | |
| 147 /** | |
| 148 * @param {!ExecutionState} execState | 130 * @param {!ExecutionState} execState |
| 149 * @param {!BreakpointInfo} info | 131 * @param {!BreakpointInfo} info |
| 150 * @return {string|undefined} | 132 * @return {string|undefined} |
| 151 */ | 133 */ |
| 152 DebuggerScript.setBreakpoint = function(execState, info) | 134 DebuggerScript.setBreakpoint = function(execState, info) |
| 153 { | 135 { |
| 154 var breakId = Debug.setScriptBreakPointById(info.sourceID, info.lineNumber,
info.columnNumber, info.condition, undefined, Debug.BreakPositionAlignment.State
ment); | 136 var breakId = Debug.setScriptBreakPointById(info.sourceID, info.lineNumber,
info.columnNumber, info.condition, undefined, Debug.BreakPositionAlignment.State
ment); |
| 155 var locations = Debug.findBreakPointActualLocations(breakId); | 137 var locations = Debug.findBreakPointActualLocations(breakId); |
| 156 if (!locations.length) | 138 if (!locations.length) |
| 157 return undefined; | 139 return undefined; |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 case ScopeType.Global: | 522 case ScopeType.Global: |
| 541 case ScopeType.With: | 523 case ScopeType.With: |
| 542 result = scopeObject; | 524 result = scopeObject; |
| 543 break; | 525 break; |
| 544 } | 526 } |
| 545 return result; | 527 return result; |
| 546 } | 528 } |
| 547 | 529 |
| 548 return DebuggerScript; | 530 return DebuggerScript; |
| 549 })(); | 531 })(); |
| OLD | NEW |