-
-
Notifications
You must be signed in to change notification settings - Fork 110
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: hopefully actually fixes bug in category builder for 'constructor' word (and other prototype stuff) #565
Conversation
…r' word (and other prototype stuff)
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.
👍 Looks good to me! Reviewed everything up to b5e9eb0 in 21 seconds
More details
- Looked at
26
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
additional comments because they didn't meet confidence threshold of50%
.
1. src/views/settings/CategoryBuilder.vue:227
:
- Assessed confidence :
0%
- Comment:
The changes from using an object to aMap
for storing words are correctly implemented. This should prevent issues with words that match Object properties like 'constructor'. Good job on this fix. - Reasoning:
The PR changes the way words are stored and accessed from an object to a Map. This is a good change for handling properties that have names that could conflict with object properties (like 'constructor'). The changes are consistent and correctly implemented across the modified lines.
Workflow ID: wflow_0JibP7twdPhVnItF
You can customize Ellipsis with review rules, user-specific overrides, quiet
mode, and more. See docs.
⌛ 12 days left in your free trial, upgrade for $20/seat/month or contact us.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #565 +/- ##
=======================================
Coverage 25.60% 25.60%
=======================================
Files 27 27
Lines 1613 1613
Branches 286 286
=======================================
Hits 413 413
- Misses 1141 1174 +33
+ Partials 59 26 -33 ☔ View full report in Codecov by Sentry. |
@john30 Haven't tested (again), but I think this should be correct now. |
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.
sorry but still not correct. as commented before, all occasions of this.words need to be checked and most probably adjusted as well.
just try the following in the browser console:
your patch would yield in behaviour such as m=new Map();m.set('example',1);console.log(Object.keys(m))
resulting in an empty array instead of an array with 'example' as the single element, because the Map can not be used like this.
instead, new Map().keys()
would have to be used but it returns an iterator (and not an array as expected somewhere in the code) so that needs to be adjusted accordingly
just out of curiosity: why do you push and merge immediately before anyone had the chance to review it?
Follow up on #564
Summary:
Updated
CategoryBuilder.vue
to useMap
for storing words, replacing object structure to handle prototype-related issues correctly.Key points:
Map
inCategoryBuilder.vue
.in
keyword withMap
methods (has
,get
,set
) to avoid prototype pollution.Generated with ❤️ by ellipsis.dev