Skip to content

Commit 1fcf9b8

Browse files
lavenzgmeta-codesync[bot]
authored andcommitted
Fix: JSI Value::toString() should check the result type (#59146)
Summary: Pull Request resolved: #59146 `global.String` could be overridden. We always need to check the return type before casting to `jsi::String`. Changelog: [Internal] Reviewed By: avp Differential Revision: D125707029 fbshipit-source-id: 15d3f83ac23d8bceb24e9e13a1f67dc4b61bb3b8
1 parent ccca5d7 commit 1fcf9b8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/react-native/ReactCommon/jsi/jsi

‎packages/react-native/ReactCommon/jsi/jsi/jsi.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ String Value::asString(IRuntime& rt) && {
923923

924924
String Value::toString(IRuntime& runtime) const {
925925
Function toString = runtime.global().getPropertyAsFunction(runtime, "String");
926-
return toString.call(runtime, *this).getString(runtime);
926+
return toString.call(runtime, *this).asString(runtime);
927927
}
928928

929929
uint64_t BigInt::asUint64(IRuntime& runtime) const {

0 commit comments

Comments
 (0)