-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): array field insert method crash in sparse array #3987
fix(core): array field insert method crash in sparse array #3987
Conversation
f8f3527
to
c68d550
Compare
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## formily_next #3987 +/- ##
=============================================
Coverage 99.55% 99.55%
=============================================
Files 152 152
Lines 6709 6716 +7
Branches 1876 1819 -57
=============================================
+ Hits 6679 6686 +7
- Misses 29 30 +1
+ Partials 1 0 -1
☔ View full report in Codecov by Sentry. |
@@ -167,6 +167,11 @@ export const patchFieldStates = ( | |||
} | |||
} | |||
}) | |||
Object.keys(target).forEach((id)=> { | |||
if(target[id] === undefined){ | |||
delete target[id] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
问题的原因是没有 delete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那加个问号是不是就行了?这个 PR 的改动逻辑时间复杂度有点高
c68d550
to
3915838
Compare
Before submitting a pull request, please make sure the following is done...
master
orformily_next
.npm test
).npm run lint
) - we've done our best to make sure these rules match our internal linting guidelines.Please do not delete the above content
What have you changed?
#3932