From 8efe2b242db585041cb09a593013469161bdfd70 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 22 May 2026 14:27:26 +0000 Subject: [PATCH] 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/26260926243 --- .../@stdlib/plot/components/svg/canvas/lib/main.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/plot/components/svg/canvas/lib/main.js b/lib/node_modules/@stdlib/plot/components/svg/canvas/lib/main.js index bfee5378b671..892aae847ae2 100644 --- a/lib/node_modules/@stdlib/plot/components/svg/canvas/lib/main.js +++ b/lib/node_modules/@stdlib/plot/components/svg/canvas/lib/main.js @@ -121,10 +121,9 @@ function Canvas( options ) { var args; var i; debug( 'Received a render event. Re-emitting...' ); - args = new Array( arguments.length+1 ); - args[ 0 ] = 'render'; + args = [ 'render' ]; for ( i = 0; i < arguments.length; i++ ) { - args[ i+1 ] = arguments[ i ]; + args.push( arguments[ i ] ); } self.emit.apply( self, args ); }