-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): Make filterUndefined null-safe (#2789)
There are a couple of places where fields accept values that are typed as `Json` per the JSII type specification. This conveys that literal `null` values may be passed and need to be preserved (as far as JSII is concerned - see aws/jsii#523). However in the CloudFormation domain, `null` is semantically equivalent to `undefined`. Now enters Javascript's confusing type system, where `null` is an `object` that cannot be converted to `object` (you read this correctly): ```js typeof null === 'object' // => true Object.entries(null); // => Thrown: // TypeError: Cannot convert undefined or null to object // at Function.entries (<canonymous>) ``` So this changes the `undefined` checks to the `null`-coercing way, so that `null` and `undefined` are handled the same way.
- Loading branch information
1 parent
5c90256
commit e4fb811
Showing
3 changed files
with
20 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters