setPropertyForKey method
void
setPropertyForKey(
- JSValue propertyKey,
- JSValue? value, {
- JSPropertyAttributes attributes = JSPropertyAttributes.kJSPropertyAttributeNone,
Implementation
void setPropertyForKey(JSValue propertyKey, JSValue? value, {JSPropertyAttributes attributes = JSPropertyAttributes.kJSPropertyAttributeNone}) {
final JSException exception = JSException.create(_context);
try {
js_bd.JSObjectSetPropertyForKey(_context.ref, _ref, propertyKey.ref, value?.ref ?? nullptr, JSPropertyAttributes.values.indexOf(attributes), exception.ref);
if (exception.shouldThrow) {
throw exception.error;
}
} finally {
exception.release();
}
}