Skip to content
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

Display inherited fields #1307

Merged
merged 2 commits into from
Apr 21, 2021
Merged

Display inherited fields #1307

merged 2 commits into from
Apr 21, 2021

Conversation

grouma
Copy link
Member

@grouma grouma commented Apr 20, 2021

Related to dart-lang/sdk#45387

The JS object has inherited fields represented as Symbols. Do a best effort collection of these fields.

@grouma grouma requested review from jacob314 and annagrin April 20, 2021 21:15
@google-cla google-cla bot added the cla: yes label Apr 20, 2021
@@ -141,6 +141,7 @@ void main() {
instance.fields.map((boundField) => boundField.decl.name).toList();
expect(fieldNames, [
'_privateField',
'abstractField',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would the private inherited fields show as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. See:
image

@grouma grouma merged commit b720291 into master Apr 21, 2021
@grouma grouma deleted the display-inherited branch April 21, 2021 00:13
Copy link
Member

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test for this code. That way you will break if DDC changed their naming convention for symbols that is depended on by the split(.).slice(-1)[0]
code.

@grouma
Copy link
Member Author

grouma commented Apr 21, 2021

Please add a test for this code. That way you will break if DDC changed their naming convention for symbols that is depended on by the split(.).slice(-1)[0]
code.

I did add a test. I created an abstract class with a property. I ensure the property is visible in the extended class. If DDC changes the test will break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants