]> git.kaiwu.me - njs.git/commit
Introduced TypedArray objects.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 25 Dec 2019 12:59:01 +0000 (15:59 +0300)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 25 Dec 2019 12:59:01 +0000 (15:59 +0300)
commitbf208048283f56435daa8abc2357fdd42976ba18
treefdd8dd55962a92d47d6876f185df0d0070c08300
parentde73bc7413cb8bd497710f818083d852c88060a1
Introduced TypedArray objects.

Added the global constructors:
  Uint8Array, Int8Array, Uint8ClampedArray, Uint16Array, Int16Array,
  Uint32Array, Int32Array, Float32Array, Float64Array.

Implemented:
    - TypedArray(),
    - TypedArray(length),
    - TypedArray(buffer, [start, [end]]),
    - TypedArray(object),
    - TypedArray(typedarray),
    - TypedArray.BYTES_PER_ELEMENT.

    - %TypedArray%.prototype.constructor
    - get %TypedArray%.prototype.buffer
    - get %TypedArray%.prototype.byteLength
    - get %TypedArray%.prototype.byteOffset
    - get %TypedArray%.prototype.length
    - %TypedArray%.prototype[@@toStringTag]
    - %TypedArray%.prototype.set(array [, start])
    - %TypedArray%.prototype.slice([start, [end]])
    - %TypedArray%.prototype.toString()
    - %TypedArray%.prototype.join(separator)
    - %TypedArray%.prototype.fill().

In collaboration with Tiago Natel de Moura.

This closes #264 issue on Github.
23 files changed:
auto/sources
src/njs.h
src/njs_array.c
src/njs_array.h
src/njs_array_buffer.c
src/njs_builtin.c
src/njs_json.c
src/njs_main.h
src/njs_number.c
src/njs_number.h
src/njs_object.c
src/njs_object_hash.h
src/njs_object_prop.c
src/njs_string.c
src/njs_typed_array.c [new file with mode: 0644]
src/njs_typed_array.h [new file with mode: 0644]
src/njs_value.c
src/njs_value.h
src/njs_value_conversion.h
src/njs_vm.h
src/njs_vmcode.c
src/test/njs_benchmark.c
src/test/njs_unit_test.c