| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 4 |
| 5 package org.chromium.sdk; | 5 package org.chromium.sdk; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * An object that represents a variable in a browser JavaScript VM, a call frame | 8 * An object that represents a variable in a browser JavaScript VM, a call frame |
| 9 * variable and/or an object property. | 9 * variable and/or an object property. |
| 10 */ | 10 */ |
| 11 public interface JsVariable { | 11 public interface JsVariable { |
| 12 /** | 12 /** |
| 13 * Returns the value of this variable. | 13 * Returns the value of this variable. |
| 14 * | 14 * |
| 15 * @return a [probably compound] JsValue corresponding to this variable. | 15 * @return a [probably compound] JsValue corresponding to this variable. |
| 16 * {@code null} if there was an error reading the value data | 16 * {@code null} if there was an error reading the value data |
| 17 * or the property has accessor descriptor | 17 * or the property has accessor descriptor |
| 18 * @see #isReadable() | 18 * @see #isReadable() |
| 19 * @throws UnsupportedOperationException if this variable is not readable | 19 * @throws UnsupportedOperationException if this variable is not readable |
| 20 */ | 20 */ |
| 21 JsValue getValue() throws UnsupportedOperationException; | 21 JsValue getValue() throws UnsupportedOperationException; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * Returns variable name. If the variable is an object property, in some imple
mentations | 24 * Returns variable name. If the variable is an object property, in some imple
mentations |
| 25 * (namely V8 Standalone protocol) the numeric property name may be decorated | 25 * (namely V8 Standalone protocol) the numeric property name may be decorated |
| 26 * with square brackets. | 26 * with square brackets. |
| 27 * @return the name of this variable | 27 * @return the name of this variable |
| 28 * TODO: do not decorate property name with square brackets, | |
| 29 * http://code.google.com/p/chromedevtools/issues/detail?id=77 | |
| 30 */ | 28 */ |
| 31 String getName(); | 29 String getName(); |
| 32 | 30 |
| 33 /** | 31 /** |
| 34 * Returns object property data if variable is an object property and its desc
riptor | 32 * Returns object property data if variable is an object property and its desc
riptor |
| 35 * is available. | 33 * is available. |
| 36 */ | 34 */ |
| 37 JsObjectProperty asObjectProperty(); | 35 JsObjectProperty asObjectProperty(); |
| 38 | 36 |
| 39 /** | 37 /** |
| 40 * Casts this to declarative variable type if available or returns null. | 38 * Casts this to declarative variable type if available or returns null. |
| 41 */ | 39 */ |
| 42 JsDeclarativeVariable asDeclarativeVariable(); | 40 JsDeclarativeVariable asDeclarativeVariable(); |
| 43 } | 41 } |
| OLD | NEW |