Skip to content

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 annagrin and jacob314 April 20, 2021 21:15
@google-cla google-cla bot added the cla: yes label Apr 20, 2021
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