mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-19 18:01:31 +00:00
Respect current byteOffset in Array#subarray (#329)
This commit is contained in:
committed by
Daniel Wirtz
parent
4f95dce6e2
commit
63b64ba69e
@ -90,7 +90,7 @@ export abstract class TypedArray<T,V> {
|
||||
else end = max(min(end, length), begin);
|
||||
var slice = memory.allocate(offsetof<this>());
|
||||
store<usize>(slice, this.buffer, offsetof<this>("buffer"));
|
||||
store<i32>(slice, begin << alignof<T>(), offsetof<this>("byteOffset"));
|
||||
store<i32>(slice, this.byteOffset + (begin << alignof<T>()), offsetof<this>("byteOffset"));
|
||||
store<i32>(slice, (end - begin) << alignof<T>(), offsetof<this>("byteLength"));
|
||||
return changetype<this>(slice);
|
||||
}
|
||||
|
Reference in New Issue
Block a user