fix: locator is now true even when other options are being used for the DOMParser#803
fix: locator is now true even when other options are being used for the DOMParser#803
Conversation
|
Hi @karfau , I think it should always be true whenever this exact option isn't given, but I understand that this probably could be a breaking change now... What do you think? |
karfau
left a comment
There was a problem hiding this comment.
Thank you for reporting and providing a fix.
I think the bug report and fix make sense.
We just need to change the expectation in the failing test.
lib/dom-parser.js
Outdated
| function DOMParser(options) { | ||
| options = options || { locator: true }; | ||
| options = options || {}; | ||
| if (typeof options.locator === 'undefined') { |
There was a problem hiding this comment.
How is this different from
| if (typeof options.locator === 'undefined') { | |
| if (options.locator === undefined) { |
?
There was a problem hiding this comment.
In this case it doesn't make any difference, so yeah I'll change that
|
Regarding the breaking change, I would say this was more an oversight. And the way the docs are describing it makes more sense. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #803 +/- ##
=======================================
Coverage 95.06% 95.06%
=======================================
Files 8 8
Lines 2167 2169 +2
Branches 570 571 +1
=======================================
+ Hits 2060 2062 +2
Misses 107 107 ☔ View full report in Codecov by Sentry. |
Fixed locator not being true by default when using any other options.
Closes #802