Skip to content

[bug] Split doesn't work with main function #476

Closed
@willemneal

Description

@willemneal

It seems that adding a main function makes String.split not work.

Here is the working example: https://webassembly.studio/?f=mn7zhulmmq9

If you build and runtestSplit it returns 13 to the console.

export function testSplit(): i32 {
  let str = "hell o o o o - - - - - - - -";
  let strs = str.split(" ");
  return strs.length;
}
// export function main(): void {

// }

If you uncomment the main function, build, and rerun it returns be 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions