Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
only look directly in the object
with the `in`, we go up the prototype chain. Which means that this
happens:

```js
let utility = 'constructor'

utility in LEGACY_CLASS_MAP // true
LEGACY_CLASS_MAP[utility].toString() // function Object() { [native code] }
```
  • Loading branch information
RobinMalfait committed Oct 10, 2024
commit 8587c66d5037bc01daf40d62457030fdb8c308fa
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function simpleLegacyClasses(
utility = utility.slice(0, -1)
}

if (utility in LEGACY_CLASS_MAP) {
if (Object.hasOwn(LEGACY_CLASS_MAP, utility)) {
let replacement = LEGACY_CLASS_MAP[utility as keyof typeof LEGACY_CLASS_MAP]
return `${variants.concat(replacement).join(':')}${important ? '!' : ''}`
}
Expand Down