Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Jun 19, 2024
1 parent ff3b62e commit 68e112f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

<details>

- [`b981bc3`](https://github.com/stdlib-js/stdlib/commit/b981bc30e83a7f88cdc2c0efca082fb31f9e1ac0) - **refactor:** avoid repeated property access _(by Athan Reines)_
- [`550285b`](https://github.com/stdlib-js/stdlib/commit/550285bf4a57dd3dabc8ed3998e7b612515fe082) - **feat:** add support for boolean and mask array assignment _(by Athan Reines)_
- [`074cbef`](https://github.com/stdlib-js/stdlib/commit/074cbef3f9d616c37c2be856a949e257481ff2fc) - **docs:** add note concerning broadcasting of nested array elements _(by Athan Reines)_
- [`b079d65`](https://github.com/stdlib-js/stdlib/commit/b079d653226019925581555fdaf9aa927ec69c0e) - **feat:** add support for integer array indexing assignment _(by Athan Reines)_
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/set_elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ function setElements( target, property, value, ctx ) {
dt = dtype( value ) || 'generic';
} else {
// When provided a "scalar", we need to check whether the value can be safely cast to the target array data type:
err = ctx.validator( value, ctx.dtype );
dt = ctx.dtype;
err = ctx.validator( value, dt );
if ( err ) {
throw err;
}
Expand All @@ -75,8 +76,7 @@ function setElements( target, property, value, ctx ) {
v = value;
}
// As the scalar can be safely cast, convert the scalar to an array having the same data type as the target array to allow for broadcasting during assignment:
v = scalar2array( v, ctx.dtype );
dt = ctx.dtype;
v = scalar2array( v, dt );
}
if ( idx.type === 'int' ) {
try {
Expand Down

0 comments on commit 68e112f

Please sign in to comment.