| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 class EvaluateException(Exception): | 4 class EvaluateException(Exception): |
| 5 pass | 5 pass |
| 6 | 6 |
| 7 class InspectorRuntime(object): | 7 class InspectorRuntime(object): |
| 8 def __init__(self, inspector_backend): | 8 def __init__(self, inspector_backend): |
| 9 self._inspector_backend = inspector_backend | 9 self._inspector_backend = inspector_backend |
| 10 self._inspector_backend.RegisterDomain( | 10 self._inspector_backend.RegisterDomain( |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 if 'error' in res: | 48 if 'error' in res: |
| 49 raise EvaluateException(res['error']['message']) | 49 raise EvaluateException(res['error']['message']) |
| 50 | 50 |
| 51 if 'wasThrown' in res['result'] and res['result']['wasThrown']: | 51 if 'wasThrown' in res['result'] and res['result']['wasThrown']: |
| 52 # TODO(nduca): propagate stacks from javascript up to the python | 52 # TODO(nduca): propagate stacks from javascript up to the python |
| 53 # exception. | 53 # exception. |
| 54 raise EvaluateException(res['result']['result']['description']) | 54 raise EvaluateException(res['result']['result']['description']) |
| 55 if res['result']['result']['type'] == 'undefined': | 55 if res['result']['result']['type'] == 'undefined': |
| 56 return None | 56 return None |
| 57 return res['result']['result']['value'] | 57 return res['result']['result']['value'] |
| OLD | NEW |