Skip to content

Commit

Permalink
Initialization fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Apr 8, 2023
1 parent 4ea2e14 commit fcc0eb5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions YantraJS.Core/Core/Array/Typed/TypedArrayParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ public static TypedArrayParameters Of(in Arguments a, int bytesPerElements)

private TypedArrayParameters(int length, int bytesPerElements, JSObject prototype)
{
buffer = null;
this.length = length;
this.byteOffset = 0;
this.bytesPerElement = bytesPerElements;
this.byteOffset = 0;
copyFrom = null;
map = null;
thisArg = null;
this.prototype = prototype;
}

private TypedArrayParameters(JSValue source, JSValue map, JSValue thisArg, int bytesPerElements, JSObject prototype)
{
buffer = null;
this.length = -1;
this.bytesPerElement = bytesPerElements;
this.byteOffset = 0;
Expand All @@ -44,9 +49,14 @@ private TypedArrayParameters(JSValue source, JSValue map, JSValue thisArg, int b
public TypedArrayParameters(
in Arguments a, int bytesPerElements)
{
prototype = a.NewPrototype;
this.bytesPerElement = bytesPerElements;
buffer = null;
length = -1;
this.bytesPerElement = bytesPerElements;
byteOffset = 0;
copyFrom = null;
map = null;
thisArg = null;
prototype = a.NewPrototype;
if (a.Length == 0)
{
buffer = null;
Expand Down

0 comments on commit fcc0eb5

Please sign in to comment.