Commit 8efe2b2
committed
style(@stdlib/plot/components/svg/canvas): fix no-new-array in onRender
The lint workflow (run 26260926243, 2026-05-22) failed on develop with a
`stdlib/no-new-array` violation at line 124 of `canvas/lib/main.js`.
The `onRender` helper pre-allocated an array via `new Array(n)` followed
by index-based assignment before passing it to `self.emit.apply()`. This
constructor form is disallowed by the `stdlib/no-new-array` rule.
Replace the three-step `new Array(n)` + `args[0]='render'` + index loop
with `args = [ 'render' ]` followed by `push()` in the existing loop.
The resulting array is a dense `Array` instance; `Function.prototype.apply`
accepts it identically, so runtime behavior is unchanged.
Ref: https://github.com/stdlib-js/stdlib/actions/runs/262609262431 parent 6e874c2 commit 8efe2b2
1 file changed
Lines changed: 2 additions & 3 deletions
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
| 124 | + | |
126 | 125 | | |
127 | | - | |
| 126 | + | |
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
| |||
0 commit comments