-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(jsii-runtime): treat "null" as "undefined" (#297)
Since most languages do not have a distinction between "null" and "undefined", jsii will effectively convert any "null" value passed into an argument, a property or inside an object to "undefined". Adds a compliance test to Java and .NET called "NullShouldBeTreatedAsUndefined". Fixes aws/aws-cdk#157 Fixes #282
- Loading branch information
Elad Ben-Israel
authored
Nov 7, 2018
1 parent
cdf5a53
commit 43fb16a
Showing
15 changed files
with
660 additions
and
4 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
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
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
22 changes: 22 additions & 0 deletions
22
...torPackageId/Amazon/JSII/Tests/CalculatorNamespace/INullShouldBeTreatedAsUndefinedData.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Amazon.JSII.Runtime.Deputy; | ||
|
||
namespace Amazon.JSII.Tests.CalculatorNamespace | ||
{ | ||
[JsiiInterface(typeof(INullShouldBeTreatedAsUndefinedData), "jsii-calc.NullShouldBeTreatedAsUndefinedData")] | ||
public interface INullShouldBeTreatedAsUndefinedData | ||
{ | ||
[JsiiProperty("arrayWithThreeElementsAndUndefinedAsSecondArgument", "{\"collection\":{\"kind\":\"array\",\"elementtype\":{\"primitive\":\"any\"}}}")] | ||
object[] ArrayWithThreeElementsAndUndefinedAsSecondArgument | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
[JsiiProperty("thisShouldBeUndefined", "{\"primitive\":\"any\",\"optional\":true}")] | ||
object ThisShouldBeUndefined | ||
{ | ||
get; | ||
set; | ||
} | ||
} | ||
} |
Oops, something went wrong.