-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test: add test for a vm indexed property #23318
Conversation
Adds a single test for a vm with an indexed property.
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.
Specifically this test adds coverage for IndexedPropertyGetterCallback and IndexedPropertyDeleterCallback
@nodejs/vm |
|
||
const x = vm.createContext({ get a() { return 5; } }); | ||
|
||
assert.strictEqual(x.a, 5); |
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.
Does IndexedPropertyGetterCallback
apply for properties returning index values or indexed properties?
Reflect.defineProperty(x, '1', { get() { return 2 } })
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 just tested that scenario and in fact, x[1] === 2
. If that's the question. I'm not sure I quite understand it.
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.
This test doesn't look like its testing index-like property names and is instead checking properties with index-like values. I'm not entirely sure what this test is trying to cover.
@jdalton How about now? We are accessing indexed property |
Could you add a comment above the test explaining which component it's testing, e.g. |
@jdalton done |
Landed in b409eaa. |
Adds a single test for a vm with an indexed property. PR-URL: #23318 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Adds a single test for a vm with an indexed property. PR-URL: #23318 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Adds a single test for a vm with an indexed property. PR-URL: #23318 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Adds a single test for a vm with an indexed property. PR-URL: #23318 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Adds a single test for a vm with an indexed property. PR-URL: #23318 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Adds a single test for a vm with an indexed property. PR-URL: #23318 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit adds a test for a vm with a single indexed property
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes