-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(python): dynamic proxies handling of setters
The Dyanmic proxies were missing an implementation of `__setattr__`, which caused setter invokations to not be forwarded to the `node` process. This is what causes aws/aws-cdk#5032
- Loading branch information
1 parent
a820217
commit eec9640
Showing
16 changed files
with
516 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
27 changes: 27 additions & 0 deletions
27
...II.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IObjectWithProperty.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,27 @@ | ||
using Amazon.JSII.Runtime.Deputy; | ||
|
||
namespace Amazon.JSII.Tests.CalculatorNamespace | ||
{ | ||
/// <summary>Make sure that setters are properly called on objects with interfaces.</summary> | ||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiInterface(nativeType: typeof(IObjectWithProperty), fullyQualifiedName: "jsii-calc.IObjectWithProperty")] | ||
public interface IObjectWithProperty | ||
{ | ||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiProperty(name: "property", typeJson: "{\"primitive\":\"string\"}")] | ||
string Property | ||
{ | ||
get; | ||
set; | ||
} | ||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiMethod(name: "wasSet", returnsJson: "{\"type\":{\"primitive\":\"boolean\"}}")] | ||
bool WasSet(); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...sts.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/IObjectWithPropertyProxy.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,35 @@ | ||
using Amazon.JSII.Runtime.Deputy; | ||
|
||
namespace Amazon.JSII.Tests.CalculatorNamespace | ||
{ | ||
/// <summary>Make sure that setters are properly called on objects with interfaces.</summary> | ||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiTypeProxy(nativeType: typeof(IObjectWithProperty), fullyQualifiedName: "jsii-calc.IObjectWithProperty")] | ||
internal sealed class IObjectWithPropertyProxy : DeputyBase, Amazon.JSII.Tests.CalculatorNamespace.IObjectWithProperty | ||
{ | ||
private IObjectWithPropertyProxy(ByRefValue reference): base(reference) | ||
{ | ||
} | ||
|
||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiProperty(name: "property", typeJson: "{\"primitive\":\"string\"}")] | ||
public string Property | ||
{ | ||
get => GetInstanceProperty<string>(); | ||
set => SetInstanceProperty(value); | ||
} | ||
|
||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiMethod(name: "wasSet", returnsJson: "{\"type\":{\"primitive\":\"boolean\"}}")] | ||
public bool WasSet() | ||
{ | ||
return InvokeInstanceMethod<bool>(new System.Type[]{}, new object[]{}); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...s.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ObjectWithPropertyProvider.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,28 @@ | ||
using Amazon.JSII.Runtime.Deputy; | ||
|
||
namespace Amazon.JSII.Tests.CalculatorNamespace | ||
{ | ||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiClass(nativeType: typeof(Amazon.JSII.Tests.CalculatorNamespace.ObjectWithPropertyProvider), fullyQualifiedName: "jsii-calc.ObjectWithPropertyProvider")] | ||
public class ObjectWithPropertyProvider : DeputyBase | ||
{ | ||
protected ObjectWithPropertyProvider(ByRefValue reference): base(reference) | ||
{ | ||
} | ||
|
||
protected ObjectWithPropertyProvider(DeputyProps props): base(props) | ||
{ | ||
} | ||
|
||
/// <remarks> | ||
/// stability: Experimental | ||
/// </remarks> | ||
[JsiiMethod(name: "provide", returnsJson: "{\"type\":{\"fqn\":\"jsii-calc.IObjectWithProperty\"}}")] | ||
public static Amazon.JSII.Tests.CalculatorNamespace.IObjectWithProperty Provide() | ||
{ | ||
return InvokeStaticMethod<Amazon.JSII.Tests.CalculatorNamespace.IObjectWithProperty>(typeof(Amazon.JSII.Tests.CalculatorNamespace.ObjectWithPropertyProvider), new System.Type[]{}, new object[]{}); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.