Open Dadido3 opened 2 years ago
Thanks for this. Is there a test case that you can add to the test suite in wasm-test-suite
, so I can see what problem is being solved with this fix?
I haven't got the wasm-test-suite to run without errors here. Any tests always fail with panic: context deadline exceeded
on the line must(chromedp.Run(ctx, actions...))
. The docker container is running, maybe there is something wrong with my chromium installation.
Anyways, the problem that this pull request fixes can be simple reproduced by this code:
import js "github.com/vugu/vugu/js"
func main() {
img := js.Global().Get("Image").New()
img.Set("src", js.ValueOf("someURL")) // js.ValueOf() isn't really needed here, but it shows the problem.
}
If i get the wasm-test-suite working the next few days, i'll write a test for it.
Finally got the tests to run in a linux container, and i added a test for the fix. Hope this covers the problem well enough. What's not covered by this test is:
FuncOf(...)
ValueOf(...)
SetIndex(...)
But the fix works similar for these functions.
I've also figured out why the tests didn't run under windows, i'll make another pull request for that fix.
The tinygo test should work when #219 is merged.
This is a straight forward fix for the problem that syscall/js doesn't know about vugu/js value.