You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.
Currently, it doesn't look like @dojo/core/lang#mixin handles null targets.
I don't think a user would intentionally pass undefined or null, but I ran across this when transitioning from Dojo 1 to Dojo 2. The Dojo 1 mixin method does handles this use case.
Maybe this expected behavior and users of mixin should handle this on a case by case basis, but felt I should bring it up anyway.
Enhancement
Currently, it doesn't look like
@dojo/core/lang#mixin
handles null targets.I don't think a user would intentionally pass
undefined
ornull
, but I ran across this when transitioning from Dojo 1 to Dojo 2. The Dojo 1 mixin method does handles this use case.Maybe this expected behavior and users of
mixin
should handle this on a case by case basis, but felt I should bring it up anyway.Package Version: 2.0.0
const obj = mixin(undefined, { age: 40 })
;https://codesandbox.io/s/zwovr308jx - Dojo 2
http://jsbin.com/bufiyi/2/edit?html,js,console - Dojo 1
Expected behavior:
const obj = mixin(undefined, { age: 40 }); // { age: 40 }
Actual behavior:
const obj = mixin(undefined, { age: 40 }); //Type Error Cannot set property 'name' of null
The text was updated successfully, but these errors were encountered: