Skip to content

parseText writes uncatchable usefull log to STDOUT or browser console. #8256

@aurium

Description

@aurium

Try the example bellow running on node.js or in a browser:

binaryen.parseText(`(module
  (func (export "foo") (param $a i32) local.get $a)
  (func (export "bar") (paXam $b i32) local.get $b)
)`)

They will both log: Fatal: 3:24: error: unrecognized instruction

However a try/catch will only get the error Program terminated with exit(1)

An ugly hack replacing console.error() won't catch on the useful message either.

Can this method just throw the first (real) error, or add that on the cause of the catchable error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions