| 826 | |
| 827 | auto symbolId = toSymbolID(propertyName); |
| 828 | |
| 829 | if (enumerable) { |
| 830 | auto result = hermes::vm::JSObject::putNamedOrIndexed(std::move(jsObject), |
| 831 | *_runtime, |
| 832 | symbolId.get(), |
| 833 | toHandle(propertyValue), |
| 834 | hermes::vm::PropOpFlags().plusThrowOnError()); |
| 835 | |
| 836 | checkException(result.getStatus(), exceptionTracker); |
| 837 | } else { |
| 838 | auto result = |
| 839 | hermes::vm::JSObject::defineOwnProperty(std::move(jsObject), |
| 840 | *_runtime, |
| 841 | symbolId.get(), |
| 842 | hermes::vm::DefinePropertyFlags::getNewNonEnumerableFlags(), |
| 843 | toHandle(propertyValue)); |
| 844 | checkException(result.getStatus(), exceptionTracker); |
| 845 | } |
| 846 | } |
| 847 | |