Open iegik opened 1 month ago
To avoid situation where provided object do not have prototype we should use Object.hasOwn.
Test1:
objToCssArray(Object.create(null))
Test2:
const obj = Object.create(null); obj.color = 'red'; objToCssArray(obj)
Test3:
const obj = { hasOwnProperty: () => { /*...*/ return true }, } objToCssArray(obj)
This change unfortunately regresses hot path performance by a decent amount
To avoid situation where provided object do not have prototype we should use Object.hasOwn.
Test1:
objToCssArray(Object.create(null))
Test2:
Test3: