From 9e97d33b78c589a0e1cce2a8ad928a00e6665ef5 Mon Sep 17 00:00:00 2001 From: Tyson Cung Date: Sat, 13 Sep 2025 09:13:20 +0800 Subject: [PATCH] chore: fix JavaScript lint errors (issue #8061) Move Foo constructor function to module scope to resolve the stdlib/no-unnecessary-nested-functions lint error. The function was previously defined inside the benchmark function but has been moved to module scope with appropriate JSDoc comments. --- .../utils/properties/benchmark/benchmark.js | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/utils/properties/benchmark/benchmark.js b/lib/node_modules/@stdlib/utils/properties/benchmark/benchmark.js index 61373d94d89b..414e2b497e6a 100644 --- a/lib/node_modules/@stdlib/utils/properties/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/utils/properties/benchmark/benchmark.js @@ -28,6 +28,34 @@ var pkg = require( './../package.json' ).name; var properties = require( './../lib' ); +// FUNCTIONS // + +/** +* Constructor function for creating benchmark test objects. +* +* @private +* @constructor +* @returns {Foo} Foo instance +*/ +function Foo() { + this.a = 'beep'; + this.b = 'boop'; + this.c = [ 1, 2, 3 ]; + this.d = {}; + this.e = null; + this.f = randu(); + defineProperty( this, 'g', { + 'value': 'bar', + 'configurable': true, + 'writable': true, + 'enumerable': false + }); + return this; +} + +Foo.prototype.h = [ 'foo' ]; + + // MAIN // bench( pkg, function benchmark( b ) { @@ -35,24 +63,6 @@ bench( pkg, function benchmark( b ) { var obj; var i; - function Foo() { - this.a = 'beep'; - this.b = 'boop'; - this.c = [ 1, 2, 3 ]; - this.d = {}; - this.e = null; - this.f = randu(); - defineProperty( this, 'g', { - 'value': 'bar', - 'configurable': true, - 'writable': true, - 'enumerable': false - }); - return this; - } - - Foo.prototype.h = [ 'foo' ]; - obj = new Foo(); b.tic();