| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 return mirror.entries(); | 106 return mirror.entries(); |
| 107 if (mirror.isSet() || mirror.isIterator()) { | 107 if (mirror.isSet() || mirror.isIterator()) { |
| 108 var result = []; | 108 var result = []; |
| 109 var values = mirror.isSet() ? mirror.values() : mirror.preview(); | 109 var values = mirror.isSet() ? mirror.values() : mirror.preview(); |
| 110 for (var i = 0; i < values.length; ++i) | 110 for (var i = 0; i < values.length; ++i) |
| 111 result.push({ value: values[i] }); | 111 result.push({ value: values[i] }); |
| 112 return result; | 112 return result; |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 DebuggerScript.getInternalProperties = function(value) | |
| 117 { | |
| 118 var properties = ObjectMirror.GetInternalProperties(value); | |
| 119 var result = []; | |
| 120 for (var i = 0; i < properties.length; i++) { | |
| 121 var mirror = properties[i]; | |
| 122 result.push({ | |
| 123 name: mirror.name(), | |
| 124 value: mirror.value().value() | |
| 125 }); | |
| 126 } | |
| 127 return result; | |
| 128 } | |
| 129 | |
| 130 DebuggerScript.setFunctionVariableValue = function(functionValue, scopeIndex, va
riableName, newValue) | 116 DebuggerScript.setFunctionVariableValue = function(functionValue, scopeIndex, va
riableName, newValue) |
| 131 { | 117 { |
| 132 var mirror = MakeMirror(functionValue); | 118 var mirror = MakeMirror(functionValue); |
| 133 if (!mirror.isFunction()) | 119 if (!mirror.isFunction()) |
| 134 throw new Error("Function value has incorrect type"); | 120 throw new Error("Function value has incorrect type"); |
| 135 return DebuggerScript._setScopeVariableValue(mirror, scopeIndex, variableNam
e, newValue); | 121 return DebuggerScript._setScopeVariableValue(mirror, scopeIndex, variableNam
e, newValue); |
| 136 } | 122 } |
| 137 | 123 |
| 138 DebuggerScript._setScopeVariableValue = function(scopeHolder, scopeIndex, variab
leName, newValue) | 124 DebuggerScript._setScopeVariableValue = function(scopeHolder, scopeIndex, variab
leName, newValue) |
| 139 { | 125 { |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 "parentPromise": eventData.parentPromise().value(), | 582 "parentPromise": eventData.parentPromise().value(), |
| 597 "status": eventData.status() | 583 "status": eventData.status() |
| 598 }; | 584 }; |
| 599 } | 585 } |
| 600 | 586 |
| 601 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr
ors in the cache we disable it. | 587 // We never resolve Mirror by its handle so to avoid memory leaks caused by Mirr
ors in the cache we disable it. |
| 602 ToggleMirrorCache(false); | 588 ToggleMirrorCache(false); |
| 603 | 589 |
| 604 return DebuggerScript; | 590 return DebuggerScript; |
| 605 })(); | 591 })(); |
| OLD | NEW |