test: add test for a vm indexed property#23318
test: add test for a vm indexed property#23318conectado wants to merge 4 commits intonodejs:masterfrom
Conversation
Adds a single test for a vm with an indexed property.
devsnek
left a comment
There was a problem hiding this comment.
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.
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.
I just tested that scenario and in fact, x[1] === 2. If that's the question. I'm not sure I quite understand it.
jdalton
left a comment
There was a problem hiding this comment.
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