feat: add ndarray/fill-slice-by#9286
Conversation
|
@kgryte any hints on the typescript 😢 |
Coverage Report
The above coverage report was generated for the changes in this PR. |
Signed-off-by: Athan <kgryte@gmail.com>
|
@kgryte I went ahead and made the changes to use |
| if ( nargs > 3 ) { | ||
| s = arguments[ nargs - 3 ]; | ||
| } | ||
| } else if ( nargs > 2 ) { // Case: fillSliceBy( x, s, clbk ) |
There was a problem hiding this comment.
This comment is not correct. You can get to this branch via other signatures.
| // Resolve slice: | ||
| if ( isMultiSlice( s ) ) { | ||
| S = s; | ||
| if ( nargs > 5 ) { |
There was a problem hiding this comment.
This check alone is not sufficient. Consider
fillSliceBy( x, Slice, MultiSlice, clbk );L112 > L120 > s = MultiSlice, but this is an invalid signature.
There was a problem hiding this comment.
Looks like you are trying to follow ndarray/fill-slice, but you need to study that logic more closely. The logic in fill-slice works because we decrement nargs, thereby constraining the argument search space.
| t.end(); | ||
| }); | ||
|
|
||
| tape( 'the function throws an error if provided a first argument which is not an ndarray (multislice)', function test( t ) { |
There was a problem hiding this comment.
In general, for these validation tests, you also need to include combinations involving providing a thisArg.
kgryte
left a comment
There was a problem hiding this comment.
Apart from needing additional tests and the argument juggling logic, this PR is coming along.
|
/stdlib update-copyright-years |
|
For METR, |
@kgryte, the slash command failed to complete. Please check the workflow logs for details. |
|
/stdlib merge |
|
/stdlib update-copyright-years |
|
/stdlib merge |
Resolves stdlib-js/metr-issue-tracker#113.
Description
This pull request:
ndarray/fill-slice-byRelated Issues
This pull request has the following related issues:
ndarray/fill-slice-bymetr-issue-tracker#113Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers