OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return this._scopes.length; | 137 return this._scopes.length; |
138 }, | 138 }, |
139 | 139 |
140 scope: function(index) | 140 scope: function(index) |
141 { | 141 { |
142 return this._scopes[index]; | 142 return this._scopes[index]; |
143 }, | 143 }, |
144 | 144 |
145 evaluate: function(expression, disableBreak) | 145 evaluate: function(expression, disableBreak) |
146 { | 146 { |
147 // FIXME: Dart VM doesn't currently support evaluations. Use | |
148 // JavaScript eval and 'with' statement to emulate evaluation on Dart | |
149 // call frame. | |
150 | |
151 // FIXME: dartbug.com/10434 find a less fragile way to determine whether | |
152 // we need to strip off console API support added by InjectedScript. | |
153 var CONSOLE_API_SUPPORT_HEADER = | |
154 'with ((this && this.console && this.console._commandLineAPI) || {})
{\n'; | |
155 if (expression.indexOf(CONSOLE_API_SUPPORT_HEADER) == 0) { | |
156 expression = expression.substr(expression.indexOf('\n') + 1); | |
157 expression = expression.substr(0, expression.lastIndexOf('\n')); | |
158 } | |
159 | |
160 var result = DartDebug.nativeCallbacks.invocationTrampoline( | 147 var result = DartDebug.nativeCallbacks.invocationTrampoline( |
161 DartDebug.nativeCallbacks.evaluateInScope, | 148 DartDebug.nativeCallbacks.evaluateInScope, |
162 [expression, this._localScope.receiver(), this._callFrame.functionPr
oxy, this._callFrame.localVariables]); | 149 [expression, this._localScope.receiver(), this._callFrame.functionPr
oxy, this._callFrame.localVariables]); |
163 return { value: function() { return result; } }; | 150 return { value: function() { return result; } }; |
164 }, | 151 }, |
165 | 152 |
166 get details_() | 153 get details_() |
167 { | 154 { |
168 var receiver = this._localScope.receiver(); | 155 var receiver = this._localScope.receiver(); |
169 return { receiver: function() { return receiver; } }; | 156 return { receiver: function() { return receiver; } }; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 387 |
401 Debug.clearBreakOnUncaughtException = function() | 388 Debug.clearBreakOnUncaughtException = function() |
402 { | 389 { |
403 originals.clearBreakOnUncaughtException.apply(Debug); | 390 originals.clearBreakOnUncaughtException.apply(Debug); |
404 DartDebug.updateExceptionPauseInfo(); | 391 DartDebug.updateExceptionPauseInfo(); |
405 } | 392 } |
406 | 393 |
407 return DartDebug; | 394 return DartDebug; |
408 | 395 |
409 })() | 396 })() |
OLD | NEW |