Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend js: no method string.split_any #21440

Open
hholst80 opened this issue May 5, 2024 · 0 comments
Open

backend js: no method string.split_any #21440

hholst80 opened this issue May 5, 2024 · 0 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@hholst80
Copy link
Contributor

hholst80 commented May 5, 2024

Describe the bug

The js backend lacks a string.split_any method.

Reproduction Steps

fn main() {
  println('foo bar'.split_any(' '))
}

Expected Behavior

Should compile and output:

['foo', 'bar']

Current Behavior

# v -b js test.v
test.v:2:21: error: unknown method or field: `string.split_any`.
Did you mean `split`?
    1 | fn main() {
    2 |   println('foo bar'.split_any(' '))
      |                     ~~~~~~~~~~~~~~
    3 | }
test.v:2:3: error: `println` can not print void expressions
    1 | fn main() {
    2 |   println('foo bar'.split_any(' '))
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    3 | }
If the code of your project is in multiple files, try with `v .` instead of `v test.v`
[I] root@trump

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.5 387af74

Environment details (OS name and version, etc.)

V full version: V 0.4.5 387af74
OS: linux, "Artix Linux"
Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz

getwd: /home/root
vexe: /home/root/Apps/v/v
vexe mtime: 2024-05-04 22:42:37

vroot: OK, value: /home/root/Apps/v
VMODULES: OK, value: /home/root/.vmodules
VTMP: OK, value: /tmp/v_0

Git version: git version 2.45.0
Git vroot status: weekly.2024.18.2-13-g2e64e284-dirty (9 commit(s) behind V master)
.git/config present: true

CC version: cc (GCC) 13.2.1 20240417
thirdparty/tcc status: thirdparty-linux-amd64 40e5cbb5

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@hholst80 hholst80 added the Bug This tag is applied to issues which reports bugs. label May 5, 2024
@hholst80 hholst80 changed the title backend js: no moethod string.split_any backend js: no method string.split_any May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant