Skip to content

Question: Having trouble getting ref-array to work with ref-struct #1

@ghost

Description

Declaring an array type such as

var uint8ArrayType = refArray(ref.types.uint8);

and then using this type in a struct declaration such as

var mystruct = refStruct({
arr : uint8ArrayType(16)
});

will cause ref to fail on coerceType with the error message

AssertionError: could not determine a proper "type" from: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
at Object.coerceType (.../node_modules/ffi/node_modules/ref/lib/ref.js:389:3)

I seems that the assertion fails due to either indirection or size being unavailable.

Is this due to a general incompatibility, which I doubt, or due to the fact that I am using some old version of either of one of the libs, namely ref-array or ref?

TIA

Carsten

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions