Log of #mupdf at irc.freenode.net.

Search:
 <<<Back 1 day (to 2020/03/10)Fwd 1 day (to 2020/03/12)>>>20200311 
avih ator: i think you should document that js_Report should never throw, or even access J other than for js_getcontext. the mujs code is not ready for it throwing, and if used during panic then js_Report should probably not even use js_try14:28.34 
  (in fact, a more correct API would probably be js_Report(void *context, const char *message), but this ship has probably sailed by now14:30.01 
ator avih: yeah... the idea is to use the js_getcontext if you need the user context14:31.17 
avih sure, but it's not documented14:31.34 
ator should probably have passed the uctx instead of the js_State, but as you said, that ship has sailed14:31.34 
  and won't prevent someone from doing weird stuff with the state anyway. will make a note in the docs!14:31.48 
avih thx14:31.56 
  ator: would you consider supporting official js_utf8_push{string,lstring,literal} which convert the input to cesu8 if required, and similarly js_utf8_tostring (and possibly js_utf8_tolstring in the future) which returns it as utf8? i.e. just for the "pure" string insertions/fetch, while leaving all other APIs as is?15:37.11 
  these could implicitly provide conversion utils between utf8/cesu8 to the user: js_pushliteral(J, str); utf8 = js_utf8_tostring(J, -1) converts to utf8, and js_utf8_pushstring(J, str); cesu8 = js_tostring(J, -1) converts to cesu8. then the user can wrap the standard APIs with ones which convert as required (taking into account the additional stack entry used when using idx)15:41.01 
  at the second case actually js_utf8_pushliteral (which takes the literal if it doesn't need conversion, else pushes it as a cesu8 string). this way allocation is only used if a conversion is required15:43.46 
  the code change in mujs to support these would be rather minimal15:44.48 
  ator: "yes"/"no"/"i don't know yet" would suffice16:58.06 
ator avih: yes.17:34.13 
avih ator: cool. i'll send a PR on github at some stage then, hopefully within a week or two17:35.44 
 <<<Back 1 day (to 2020/03/10)Forward 1 day (to 2020/03/12)>>> 
ghostscript.com #ghostscript
Search: