1

I'm writing an extension to the extension "Binary File Viewer" for VS Code. My code is

/**
 * Select the 'aid' extension.
 */
registerFileType((fileExt, filePath, fileData) => {
    return fileExt == 'wav';
});

registerParser(() => {
    const buffer = new ArrayBuffer(4);

    let temp = new DataView(buffer);
    temp.setInt32(0, 123)
    let I = String(temp.getFloat32());
    addRow('I', I, '');
});

When I run it (actually, when it's involved by the Binary File Viewer), I have an error "Type error: ArrayBuffer is not a constructor". What I've done wrong?

Dmitry
  • 116
  • 4
  • 1
    Something seems to be shadowing it. – xehpuk Jul 22 '22 at 22:31
  • What do you get when you `console.log(ArrayBuffer)`? – Bergi Jul 23 '22 at 03:19
  • 1
    @xehpuk I have an error "TypeError: Cannot read properties of undefined (reading 'log')". Sorry if my questions or answers look stupid. I'm absoultely new in JS. I'm a C++ guy who needs to figure out with a specific file type. So I need to write this parser. – Dmitry Jul 23 '22 at 18:52

0 Answers0