Skip to content

Commit b9cb0cf

Browse files
committed
Auto-generated commit
1 parent 4a69877 commit b9cb0cf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-04-27)
7+
## Unreleased (2025-04-28)
88

99
<section class="features">
1010

@@ -298,6 +298,7 @@ A total of 13 issues were closed in this release:
298298

299299
<details>
300300

301+
- [`25abfc6`](https://github.com/stdlib-js/stdlib/commit/25abfc67b400f646304fa1f10b239a051f6569f6) - **refactor:** support non-built-in shape and strides objects _(by Athan Reines)_
301302
- [`b087d7b`](https://github.com/stdlib-js/stdlib/commit/b087d7b801c7cae56cb39587b295fb7433638405) - **feat:** add support for enforcing traversal order _(by Athan Reines)_
302303
- [`d1bc036`](https://github.com/stdlib-js/stdlib/commit/d1bc0365ded44eefb0073b8ae9bf582041b49be5) - **feat:** add support for enforcing traversal order _(by Athan Reines)_
303304
- [`aa7edbf`](https://github.com/stdlib-js/stdlib/commit/aa7edbf50d41cdea1f28b13537f2810fa84ef3c7) - **feat:** add support for enforcing traversal order _(by Athan Reines)_

base/ctor/lib/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var setReadOnlyAccessor = require( '@stdlib/utils/define-nonenumerable-read-only
2828
var bytesPerElement = require( './../../../base/bytes-per-element' );
2929
var iterationOrder = require( './../../../base/iteration-order' );
3030
var strides2order = require( './../../../base/strides2order' );
31+
var slice = require( '@stdlib/array/base/slice' );
3132
var Boolean = require( '@stdlib/boolean/ctor' );
3233
var isColumnMajorContiguous = require( './is_column_major_contiguous.js' );
3334
var isRowMajorContiguous = require( './is_row_major_contiguous.js' );
@@ -90,7 +91,7 @@ function ndarray( dtype, buffer, shape, strides, offset, order ) {
9091
// Compute the number of elements...
9192
len = 1;
9293
for ( i = 0; i < shape.length; i++ ) {
93-
len *= shape[ i ];
94+
len *= shape[ i ]; // TODO: consider supporting accessor arrays here
9495
}
9596
// Compute the number of bytes...
9697
if ( buffer.BYTES_PER_ELEMENT ) {
@@ -370,7 +371,7 @@ setReadOnlyAccessor( ndarray.prototype, 'order', function get() {
370371
* // returns [ 3, 2 ]
371372
*/
372373
setReadOnlyAccessor( ndarray.prototype, 'shape', function get() {
373-
return this._shape.slice();
374+
return slice( this._shape, 0, this._shape.length );
374375
});
375376

376377
/**
@@ -392,7 +393,7 @@ setReadOnlyAccessor( ndarray.prototype, 'shape', function get() {
392393
* // returns [ 2, 1 ]
393394
*/
394395
setReadOnlyAccessor( ndarray.prototype, 'strides', function get() {
395-
return this._strides.slice();
396+
return slice( this._strides, 0, this._strides.length );
396397
});
397398

398399
/**

0 commit comments

Comments
 (0)