mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Implement more missing methods on WithRuntimeDecorator (#45049)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45049 WithRuntimeDecorator is missing many methods that were added after it. Add implementations for them. The underlying issue here is that because this inherits from RuntimeDecorator, which implements all methods, there is no compilation error for this runtime when we add new methods. Changelog: [GENERAL] [FIXED] - Add missing methods to the WithRuntimeDecorator class. Reviewed By: avp Differential Revision: D58752127 fbshipit-source-id: d80b4ed1c38698ed3850d0cd961bf7ddde2449a0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
218ea5d44c
commit
993f9fd8db
@@ -582,6 +582,10 @@ class WithRuntimeDecorator : public RuntimeDecorator<Plain, Base> {
|
||||
Around around{with_};
|
||||
return RD::cloneSymbol(pv);
|
||||
};
|
||||
Runtime::PointerValue* cloneBigInt(const Runtime::PointerValue* pv) override {
|
||||
Around around{with_};
|
||||
return RD::cloneBigInt(pv);
|
||||
};
|
||||
Runtime::PointerValue* cloneString(const Runtime::PointerValue* pv) override {
|
||||
Around around{with_};
|
||||
return RD::cloneString(pv);
|
||||
@@ -610,6 +614,10 @@ class WithRuntimeDecorator : public RuntimeDecorator<Plain, Base> {
|
||||
Around around{with_};
|
||||
return RD::createPropNameIDFromString(str);
|
||||
};
|
||||
PropNameID createPropNameIDFromSymbol(const Symbol& sym) override {
|
||||
Around around{with_};
|
||||
return RD::createPropNameIDFromSymbol(sym);
|
||||
};
|
||||
std::string utf8(const PropNameID& id) override {
|
||||
Around around{with_};
|
||||
return RD::utf8(id);
|
||||
@@ -624,6 +632,31 @@ class WithRuntimeDecorator : public RuntimeDecorator<Plain, Base> {
|
||||
return RD::symbolToString(sym);
|
||||
};
|
||||
|
||||
BigInt createBigIntFromInt64(int64_t i) override {
|
||||
Around around{with_};
|
||||
return RD::createBigIntFromInt64(i);
|
||||
};
|
||||
BigInt createBigIntFromUint64(uint64_t i) override {
|
||||
Around around{with_};
|
||||
return RD::createBigIntFromUint64(i);
|
||||
};
|
||||
bool bigintIsInt64(const BigInt& bi) override {
|
||||
Around around{with_};
|
||||
return RD::bigintIsInt64(bi);
|
||||
};
|
||||
bool bigintIsUint64(const BigInt& bi) override {
|
||||
Around around{with_};
|
||||
return RD::bigintIsUint64(bi);
|
||||
};
|
||||
uint64_t truncate(const BigInt& bi) override {
|
||||
Around around{with_};
|
||||
return RD::truncate(bi);
|
||||
};
|
||||
String bigintToString(const BigInt& bi, int i) override {
|
||||
Around around{with_};
|
||||
return RD::bigintToString(bi, i);
|
||||
};
|
||||
|
||||
String createStringFromAscii(const char* str, size_t length) override {
|
||||
Around around{with_};
|
||||
return RD::createStringFromAscii(str, length);
|
||||
@@ -637,6 +670,11 @@ class WithRuntimeDecorator : public RuntimeDecorator<Plain, Base> {
|
||||
return RD::utf8(s);
|
||||
}
|
||||
|
||||
Value createValueFromJsonUtf8(const uint8_t* json, size_t length) override {
|
||||
Around around{with_};
|
||||
return RD::createValueFromJsonUtf8(json, length);
|
||||
};
|
||||
|
||||
Object createObject() override {
|
||||
Around around{with_};
|
||||
return RD::createObject();
|
||||
@@ -797,6 +835,11 @@ class WithRuntimeDecorator : public RuntimeDecorator<Plain, Base> {
|
||||
Around around{with_};
|
||||
return RD::strictEquals(a, b);
|
||||
};
|
||||
bool strictEquals(const BigInt& a, const BigInt& b) const override {
|
||||
Around around{with_};
|
||||
return RD::strictEquals(a, b);
|
||||
};
|
||||
|
||||
bool strictEquals(const String& a, const String& b) const override {
|
||||
Around around{with_};
|
||||
return RD::strictEquals(a, b);
|
||||
@@ -811,6 +854,12 @@ class WithRuntimeDecorator : public RuntimeDecorator<Plain, Base> {
|
||||
return RD::instanceOf(o, f);
|
||||
};
|
||||
|
||||
void setExternalMemoryPressure(const jsi::Object& obj, size_t amount)
|
||||
override {
|
||||
Around around{with_};
|
||||
RD::setExternalMemoryPressure(obj, amount);
|
||||
};
|
||||
|
||||
private:
|
||||
// Wrap an RAII type around With& to guarantee after always happens.
|
||||
struct Around {
|
||||
|
||||
Reference in New Issue
Block a user