Log of #mupdf at irc.freenode.net.

Search:
 <<<Back 1 day (to 2018/04/25)20180426 
moolc Robin_Watts: "Receiving objects: 100% (467/467), 23.84 MiB | 1.66 MiB/s, done." looks as if the git throughput problem is gone08:36.09 
tor8 moolc: it's intermittent ... sometime I get terrible throughput from AWS too08:38.53 
moolc tor8: i've updated the building instructions for llpp not to hammer git. ghostscript and exacerbate the problem (by all llpp 3 users)08:39.35 
avih tor8: hey. i believe mujs is incorrect for String.match(<regex with global>). it returns an empty array instead of null. see ECMA262-5.1 15.5.4.10 - 8.g and it seems missing from Sp_match at jsstring.c11:24.27 
  (if there are no matches, of course :) )11:26.49 
  i.e. "hello".match(/foo/g) should return null11:27.30 
tor8 avih: yes, you're quite right.11:28.34 
  I'm missing step 8.g.11:28.47 
avih yeah11:28.52 
  what? the entirety of 8?11:29.08 
  i only looked at its end... assumed 8 itself is there.. but glad you caught it :)11:29.38 
  oh. 8.g, yes11:30.00 
tor8 avih: fix pushed.11:31.12 
avih thx11:31.16 
  tor8: wondering, why did you pop the array? it implicitly GC'ed anyway when it returns, doesn't it?11:32.42 
tor8 it is automatically cleaned up by the function call opcode, but this saves it needing to do that work and is easier to understeand11:33.51 
  it is safe to push too much on the stack, but it's not really good form11:34.14 
avih does it actually do anything for the cleanup? it just takes top and "cuts" the stack without going through each of its items, or does it? to mark it for GC?11:35.12 
  i guess it does need to mark it. but then if it does, then i'd assume pop would need the same. OTOH, no disagreement about clarity11:36.02 
tor8 avih: not really. the 'call' opcode takes the top value of the stack and zaps everything between the saved stack top and that.11:36.10 
  nothing to do with gc11:36.25 
avih hmm.. so just the clarity argument, yes?11:36.29 
tor8 yeah. just clarity.11:36.39 
avih k. thx11:36.44 
  tor8: i think there's a bug where Array.sort converts its items to strings instead of just using their toString value but otherwise keeping them unmodified. can that be?16:01.42 
  or rather, is that the case? :)16:02.06 
  also, does it do bubble sort?!16:05.39 
  tor8: https://pastebin.mozilla.org/9083991 ?16:19.49 
  (seems to fix it for me)16:19.57 
  i don't quite get why it works though. js_hasindex should already do exactly that...16:22.06 
  ok, i think i get it. compare leaves the stringified values at TOP, and sort assumes they're the original values and puts them at the array. so my patch is correct afterall.16:36.17 
  also, please make it quicksort or anything nicer than bubblesort :)16:42.19 
  also, seems like mujs' sort drops existing but undefined elements from the array. firefox and chrome don't.19:42.06 
  or rather, mujs' sort converts undefined to empty elements.19:43.17 
pink_mist what's the difference between an undefined and an empty element? (just curious)19:45.27 
avih no, sorry, it does the correct thing, but Array.prototype.toString prints it as an empty element (firefox/chrome print it as undefined)19:48.36 
  pink_mist: undefined is an actual value. for instance consider x = { a: 1, b: undefined } then x.a clearly exists and defined (1), x.b exists and its value is undefined. x.c doesn't exist (at x, but might be inherited). empty value at an array means it's a sparse array. undefined value is exactly that - its value is the js value undefined. to tell one from the otehr you have to use the .hasOwnProperty method. e.g. x.hasOwnProperty("b") is true, but for c it's19:52.02 
  false. for an array the property name you test for is the array index you want to test.19:52.02 
pink_mist ahh, alright, sparse array, got it, thanks =)19:53.08 
avih re sort and undefined, mujs is actually ok. its toString prints it as ampty, and so do firefox and chrome when invoking .toString(). but at the development console undefined is printed as undefined.19:57.10 
tor8 avih: yeah, some consoles print values using something other than toString21:51.17 
 Forward 1 day (to 2018/04/27)>>> 
ghostscript.com #ghostscript
Search: