Skip to content

Commit

Permalink
revert dummy global changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wkozyra95 committed Aug 4, 2021
1 parent 1452dc6 commit f846704
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Common/cpp/Tools/RuntimeDecorator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ void RuntimeDecorator::decorateRuntime(jsi::Runtime &rt, const std::string &labe
rt.global().setProperty(rt, "_WORKLET", jsi::Value(true));
// This property will be used for debugging
rt.global().setProperty(rt, "_LABEL", jsi::String::createFromAscii(rt, label));

jsi::Object dummyGlobal(rt);
auto dummyFunction = [](
jsi::Runtime &rt,
const jsi::Value &thisValue,
Expand All @@ -27,8 +29,8 @@ void RuntimeDecorator::decorateRuntime(jsi::Runtime &rt, const std::string &labe
};
jsi::Function __reanimatedWorkletInit = jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "__reanimatedWorkletInit"), 1, dummyFunction);

rt.global().setProperty(rt, "__reanimatedWorkletInit", __reanimatedWorkletInit);
rt.global().setProperty(rt, "global", rt.global());
dummyGlobal.setProperty(rt, "__reanimatedWorkletInit", __reanimatedWorkletInit);
rt.global().setProperty(rt, "global", dummyGlobal);

rt.global().setProperty(rt, "jsThis", jsi::Value::undefined());

Expand Down Expand Up @@ -152,7 +154,7 @@ void RuntimeDecorator::decorateUIRuntime(jsi::Runtime &rt,

rt.global().setProperty(rt, "_frameTimestamp", jsi::Value::undefined());
rt.global().setProperty(rt, "_eventTimestamp", jsi::Value::undefined());

// layout animation
std::weak_ptr<LayoutAnimationsProxy> layoutProxy = layoutAnimationsProxy;
auto clb7 = [layoutProxy](
Expand All @@ -170,7 +172,7 @@ void RuntimeDecorator::decorateUIRuntime(jsi::Runtime &rt,
};
jsi::Value _startObservingProgress = jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, "_startObservingProgress"), 0, clb7);
rt.global().setProperty(rt, "_startObservingProgress", _startObservingProgress);

auto clb8 = [layoutProxy](
jsi::Runtime &rt,
const jsi::Value &thisValue,
Expand Down

0 comments on commit f846704

Please sign in to comment.