-
Notifications
You must be signed in to change notification settings - Fork 245
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(python): reference isomorphism is broken within __init__ #1724
Conversation
Within the `__init__` of a class, reading `self` back from the JS process would result in a proxy object created for the parent type, instead of returning `self`. This is because the `JSIIMeta` metaclass only registered the instance in the rerefence map **after** the constructor had returned. This adds an additional registration point right after the `create` API returned from the kernel, making the reference available as early as it can possibly be known. Fixes aws/aws-cdk#8262
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 |
Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it! |
Merging (with squash)... |
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 |
Merging (with squash)... |
Within the
__init__
of a class, readingself
back from the JSprocess would result in a proxy object created for the parent type,
instead of returning
self
. This is because theJSIIMeta
metaclassonly registered the instance in the rerefence map after the
constructor had returned.
This adds an additional registration point right after the
create
APIreturned from the kernel, making the reference available as early as it
can possibly be known.
Fixes aws/aws-cdk#8262
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.