-
Notifications
You must be signed in to change notification settings - Fork 29
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
jq flags -r
effect seems can't cancel between calls ?
#15
Comments
Oh, you mean once you pass a flag it keeps being applied to next calls? |
yes |
-r
seems can't cancel ?-r
effect seems can't cancel between calls ?
seems some parse error state also persist: // run in linux chrome 74.0.3729.131 64bit > jq.raw('{"a":"hello"}', '.a')
< ""hello""
// try parse err
> jq.raw('{"a":,"hello"}', '.a')
< jq.wasm.js:6 Uncaught parse error: Expected value before ',' at line 1, column 6
// following call is sick, infected
> jq.raw('{"a":"hello"}', '.a')
< "" |
This is very odd. I took a look at it but can't see where the error is. Maybe we need an Emscripten specialist. |
// init bin arr once
var res = await fetch('jq_github/jq.wasm.wasm')
var arr = await res.arrayBuffer()
// reload asm when necessary
var mod = await WebAssembly.instantiate(arr, info) //info from jq.wasm.js createWasm()
Module.asm = mod.instance.exports //Module from jq.wasm.js I use this code reload the asm, which can fix the parse err state, |
> jq.raw('\n12', '.')
< "12"
> jq.raw('123\n', '.')
< "123"
> jq.raw('1234', '.')
< "" input end with // reload asm also can fix this, but we can't detect this state normally, |
had a glance at jq c code. static int options = 0; I guess the global static var maybe need clean the stack & heap before next time call |
Wow, I guess we've found our Emscripten specialist! I have no idea of how to do that. It would be great if you could open a pull request. |
sorry for late response, busy year after year.
|
|
about stdout, stderrcurrent code only show err when stdout got nothing but, sometimes it can output both stdout,stderr.
a PR here, |
version: release-0.5.1
jq.wasm.js
run in chrome F12.
then refresh page,
and worked well again.
The text was updated successfully, but these errors were encountered: