question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ArrayBufferView#length missing

See original GitHub issue

The TypedArray documentation (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) shows there is a TypedArray#length member that indicates the number of elements in the array.

ArrayBufferView is an alias for TypedArray (https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView). Therefore, it should also have a length property. However, the tslib ArrayBufferView interface does not have it:

Screen Shot 2020-05-02 at 8 35 44 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
englercjcommented, May 4, 2020

An ArrayBufferView is one of Uint8Array, Int32Array, etc., right?

Yes, including DataView which does not have that property. Look closely at the ArrayBufferView link you posted to MDN. The last item on the list is DataView.

If, in fact, they are the same thing - then what type is in tslib that represents TypedArray?

ArrayBufferView represents a TypedArray. A DataView is a typed array.

0reactions
englercjcommented, May 4, 2020

That sounds like a userland thing, not a tslib provided type. As the MDN states, there is no interface or constructor called TypedArray, so i wouldn’t expect this library to provide one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ArrayBuffer has no data when using the incoming data
JavaScript's ArrayBuffer has one constructor which takes the size , in bytes, of the array buffer to create. Try new ArrayBuffer(msg.data.length); ...
Read more >
ArrayBuffer.prototype.byteLength - JavaScript - MDN Web Docs
The byteLength accessor property represents the length of an ArrayBuffer in bytes.
Read more >
RangeError: invalid array length - JavaScript
The length property of an Array or an ArrayBuffer is represented with an unsigned 32-bit integer, that can only store values which are...
Read more >
Typed arrays - Binary data in the browser - web.dev
To use Typed Arrays, you need to create an ArrayBuffer and a view to it. The easiest way is to create a typed...
Read more >
ArrayBuffer, binary arrays - The Modern JavaScript Tutorial
The basic binary object is ArrayBuffer – a reference to a fixed-length contiguous memory area. We create it like this:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found