| 651 | } |
| 652 | |
| 653 | void QuickJSJavaScriptContext::setObjectProperty(const Valdi::JSValue& object, |
| 654 | const std::string_view& propertyName, |
| 655 | const Valdi::JSValue& propertyValue, |
| 656 | bool enumerable, |
| 657 | Valdi::JSExceptionTracker& exceptionTracker) { |
| 658 | auto guard = _threadAccessChecker.guard(); |
| 659 | // JS_SetProperty() automatically releases the given value. |
| 660 | auto retainedJsValue = JS_DupValue(_context, fromValdiJSValue(propertyValue)); |
| 661 | |
| 662 | if (VALDI_LIKELY(enumerable)) { |
| 663 | checkCall(exceptionTracker, |
| 664 | JS_SetPropertyStr(_context, fromValdiJSValue(object), propertyName.data(), retainedJsValue)); |
| 665 | } else { |
| 666 | auto convertedPropertyName = newPropertyName(propertyName); |
| 667 | setObjectPropertyNonEumerable(object, convertedPropertyName.get(), retainedJsValue, exceptionTracker); |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | void QuickJSJavaScriptContext::setObjectProperty(const Valdi::JSValue& object, |
| 672 | const Valdi::JSPropertyName& propertyName, |
nothing calls this directly
no test coverage detected