| 455 | } |
| 456 | |
| 457 | Value jsObjectToValue(IJavaScriptContext& jsContext, |
| 458 | const JSValue& jsValue, |
| 459 | const ReferenceInfoBuilder& referenceInfoBuilder, |
| 460 | JSExceptionTracker& exceptionTracker) { |
| 461 | auto* valueMarshaller = jsContext.getValueMarshaller(); |
| 462 | |
| 463 | if (valueMarshaller == nullptr) { |
| 464 | return untypedJsObjectToValue(jsContext, jsValue, referenceInfoBuilder, exceptionTracker); |
| 465 | } |
| 466 | |
| 467 | auto output = valueMarshaller->tryUnwrap(jsValue, exceptionTracker); |
| 468 | if (!exceptionTracker) { |
| 469 | return output; |
| 470 | } |
| 471 | |
| 472 | if (output.isUndefined()) { |
| 473 | // No proxy objects found in the object, marshall as a plain map |
| 474 | return untypedJsObjectToValue(jsContext, jsValue, referenceInfoBuilder, exceptionTracker); |
| 475 | } else { |
| 476 | // Proxy object found, return it |
| 477 | return output; |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | size_t jsArrayGetLength(IJavaScriptContext& jsContext, const JSValue& jsValue, JSExceptionTracker& exceptionTracker) { |
| 482 | static auto kLength = STRING_LITERAL("length"); |
no test coverage detected