-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(kernel): "any" serialization breaks private type instances #1347
Conversation
When a "private" type (aka a class that is not visible in the `.jsii` assembly) is passed from JS to Host through an `any`-typed entity, the value was serialized by-value, passing only the instance's properties, and omitting any methods. This changes the behavior of the `SerializationClass.Any` serializer, so that when an anonymous object is encountered, if it has a dynamic getter, setter or any method (including a constructor), it is passed by-reference instead of by-value. Fixes aws/aws-cdk#6746
7b171d8
to
8221e5e
Compare
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
When a "private" type (aka a class that is not visible in the
.jsii
assembly) is passed from JS to Host through an
any
-typed entity, thevalue was serialized by-value, passing only the instance's properties,
and omitting any methods.
This changes the behavior of the
SerializationClass.Any
serializer,so that when an anonymous object is encountered, if it has a dynamic
getter, setter or any method (including a constructor), it is passed
by-reference instead of by-value.
Fixes aws/aws-cdk#6746
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.