-
-
Notifications
You must be signed in to change notification settings - Fork 562
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
Add ObjectWrapperReportedMemberTypes to Options #1947
Conversation
91b39c0
to
c2d36eb
Compare
fix fix rename fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this needs some discussion.
The JavaScript behavior for get
/set
etc:
var base = {
baseField: "foo",
funcBase() {
},
get propBase() {
},
set propBase(val) {
},
};
var a = {
aField: 0,
funcA() {
},
get propA() {
},
set propA(val) {
},
}
Object.setPrototypeOf(a, base);
console.log("own: " + Object.getOwnPropertyNames(a));
console.log("enumerable properties");
for (var k in a) {
console.log(k);
}
Output:
own: aField,funcA,propA
enumerable properties
aField
funcA
propA
baseField
funcBase
propBase
So the correct output for the "full" test case should be:
jsProps.Should().BeSameAs(["A", "F"]);
It should not contain inherited ones and property get
/set
and not listed as it's implied by the property. GetType
is already special cased in configuration anyway not to be allowed as it opens reflection. So I think only addition should be own methods that are not property get/set or any other special name (m.IsSpecialName
).
Jint.Tests/Runtime/InteropTests.cs
Outdated
engine.SetValue("clrInstance", new ClrMembersVisibilityTestClass()); | ||
|
||
var getValue = engine.Evaluate("clrInstance.get_A()"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just engine.Evaluate("clrInstance.get_A()").Should().Be(10);
, but I'm goin to argument that the current behavior is wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well not sure if the possibility to call is wrong, but the idiomatic way is to evaluate clrInstance.A
Thanks for the feedback, the requested changes are in 654d557, we can squash it after your review.
|
fa4a4f1
to
654d557
Compare
I have no idea why or how the Linux tests are failing:
Maybe this?
|
No worries, I'll look into this and from quick look seems good. Thanks for iterating and discussing 👍🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I tweaked a bit for readability. Thanks for fixing this!
@lahma why are we taking |
It would break existing test case, if you want to check the feasibility for the change, a PR and investigation is always welcome 🙂 |
|
For me it's |
So I guess it's a case of |
Let build server be the judge: #1948 Failed test summary: https://github.com/sebastienros/jint/actions/runs/10434541945?pr=1948 |
I'll try to get my environment to be consistent with the build server then and look into the failing test. |
Implements the feature discussed in #1945.