diff --git a/ReactCommon/jsi/jsi/JSIDynamic.cpp b/ReactCommon/jsi/jsi/JSIDynamic.cpp index 4464cc3b62f..02f112c0e0c 100644 --- a/ReactCommon/jsi/jsi/JSIDynamic.cpp +++ b/ReactCommon/jsi/jsi/JSIDynamic.cpp @@ -129,8 +129,7 @@ void dynamicFromValueShallow( output = value.getNumber(); } else if (value.isString()) { output = value.getString(runtime).utf8(runtime); - } else { - CHECK(value.isObject()); + } else if (value.isObject()) { Object obj = value.getObject(runtime); if (obj.isArray(runtime)) { output = folly::dynamic::array(); @@ -140,6 +139,12 @@ void dynamicFromValueShallow( output = folly::dynamic::object(); } stack.emplace_back(&output, std::move(obj)); + } else if (value.isBigInt()) { + throw JSError(runtime, "JS BigInts are not convertible to dynamic"); + } else if (value.isSymbol()) { + throw JSError(runtime, "JS Symbols are not convertible to dynamic"); + } else { + throw JSError(runtime, "Value is not convertible to dynamic"); } }