getProperty method

JSValue getProperty(
  1. String propertyName
)

Implementation

JSValue getProperty(String propertyName) {
  final JSException exception = JSException.create(_context);
  final JSString jsPropertyName = JSString.fromString(propertyName);
  try {
    final JSValueRef valueRef = js_bd.JSObjectGetProperty(_context.ref, _ref, jsPropertyName.ref, exception.ref);
    if (exception.shouldThrow) {
      throw exception.error;
    }
    return JSValue(_context, valueRef);
  } finally {
    jsPropertyName.release();
    exception.release();
  }
}