| 77 | } |
| 78 | |
| 79 | JSValue JSValueRefHolder::getJsValue(IJavaScriptContext& jsContext, JSExceptionTracker& exceptionTracker) const { |
| 80 | auto jsValue = jsContext.getStashedJSValue(_jsValueId); |
| 81 | if (!jsValue) { |
| 82 | auto errorMessage = STRING_FORMAT( |
| 83 | "Cannot unwrap JS value reference '{}' as it was disposed. Reference was taken from context {}", |
| 84 | _referenceInfo, |
| 85 | _context->getIdAndPathString()); |
| 86 | throwReferenceError(exceptionTracker, Error(errorMessage, ErrorCodes::Composer::CANNOT_UNWRAP_DISPOSED_JS_VALUE)); |
| 87 | return JSValue(); |
| 88 | } |
| 89 | |
| 90 | return jsValue.value(); |
| 91 | } |
| 92 | |
| 93 | void JSValueRefHolder::clearJsValue(IJavaScriptContext& jsContext) { |
| 94 | auto lock = _context->lock(); |
no test coverage detected