I'm working on an Adobe ExtendScript (.jsx), which is basically a subset of the older ECMAScript 3 JavaScript standard.
In order to use open source developed code, written in JS ECMAScript 5+, I need to implement Typed Arrays, (through Monkeypatching or other technique), in order to differentiate Uint8Array from "regular" Arrays.
You can try this polyfill with ExtendScript. It does not work right out of the box though:
final
as ExtendScript thinks it's a reserved keyword. Just prepend with underscore (ie._final
).self
given as argument to the patch must be replaced withthis
I have done very limited test with this polyfill in ExtendScript but seem to work fairly fine for simpler things, even with the reduced performance you would otherwise would have.
It will return true for
array instanceof Uint8Array
(assuming of coursearray
was declared as one).