Skip to content

Commit

Permalink
Merge pull request #538 from jpudysz/feature/sealed
Browse files Browse the repository at this point in the history
fix: breakpoints dependencies reported before other depndencies
  • Loading branch information
jpudysz authored Jan 30, 2025
2 parents 2ea3bf4 + d1fdf53 commit 0e9fd5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cxx/core/Unistyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ struct Unistyle {
inline bool dependsOn(UnistyleDependency dependency) {
return std::find(this->dependencies.begin(), this->dependencies.end(), dependency) != this->dependencies.end();
}

inline bool isSealed() {
return this->_isSealed;
}

inline void seal() {
this->_isSealed = true;
Expand Down
6 changes: 4 additions & 2 deletions cxx/parser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,10 @@ jsi::Object parser::Parser::parseFirstLevel(jsi::Runtime& rt, Unistyle::Shared u

helpers::enumerateJSIObject(rt, style, [&](const std::string& propertyName, jsi::Value& propertyValue){
// parse dependencies only once
if (propertyName == helpers::STYLE_DEPENDENCIES && unistyle->dependencies.empty()) {
unistyle->dependencies = this->parseDependencies(rt, propertyValue.asObject(rt));
if (propertyName == helpers::STYLE_DEPENDENCIES && !unistyle->isSealed()) {
auto newDeps = this->parseDependencies(rt, propertyValue.asObject(rt));

unistyle->dependencies.insert(unistyle->dependencies.end(), newDeps.begin(), newDeps.end());

return;
}
Expand Down

0 comments on commit 0e9fd5a

Please sign in to comment.