| <<<Back 1 day (to 2020/03/16) | Fwd 1 day (to 2020/03/18)>>> | 20200317 |
avih | ator: the documentation of js_Put does not match the implementation. it says: ""Put" should pop a value and return true if it wants to handle the property.", but jsR_setproperty - where calling the userdata put happens, is not expected to pop a value. every place which uses jsR_setproperty also does pop right afterwards. i think that jsR_setproperty should dup the value before calling a userdata put, and pop it if put returned 0 | 09:04.45 |
| (fwiw, i'm not sure whether the documentation should be modified or the implementation. if anyone tried to follow the documentation the'd have gotten a corrupted stack with one too many pop, so probably no one used it so far) | 09:06.37 |
mazheng | I try to add a transparent png image to a pdf file,but there is a question the png image with black background, somebody can help me? | 09:08.22 |
| When i extract a image with alpha, the image also with black background. | 09:09.21 |
avih | though iirc your typedArray thingy does userdata, and i'm assuming it does use put. worth checking out as well. | 09:09.56 |
| also, from the doc it's not entirely clear if the user is supposed to always pop, or only pop if it wants to handle it (one could guess the latter) | 09:11.10 |
| i suggest to fix the docs rather than the implementation. i.e. their put implementation should leave the stack unmodified. | 09:14.48 |
| yeah, the typedArray implementation of N ## Array_put also doesn't pop it | 09:18.12 |
| just fix the docs. | 09:18.31 |
ator | mazheng: PDF doesn't support alpha in images (except for JPEG2000) | 10:50.48 |
avih | ator: also, the js_Report doc still doesn't say that it should not touch the vm other than js_getcontext | 11:30.03 |
| (and must not throw and should not even do js_try) | 11:30.47 |
ator | avih: I'll have a look. | 12:04.57 |
| avih: yeah, the docs are wrong. | 12:09.46 |
avih | yeah | 12:09.58 |
| ator: what's the difference between OP_SETPROP_S and OP_SETPROP ? it seems to me that the former is a literal string which is not on the stack (e.g. at the lexer storage or interned etc), and the latter is a stack value? | 12:21.00 |
| (i'm trying to completely remove all interned strings. i think it's doable, and without unrequired allocations except if the name comes from the external API and is not from a js_Value) | 12:22.05 |
| ator: two unrelated bugs: this line should come after newmemstring or else the value becomes corrupted on OOM (and it's on stack, so it might survive the OOM with try/catch) https://github.com/ccxvii/mujs/blob/master/jsvalue.c#L315 | 12:30.21 |
| ator: and this line should use "[object iterator]" instead of "[iterator]" https://github.com/ccxvii/mujs/blob/master/jsobject.c#L45 | 12:30.45 |
ator | OP_SETPROP_S takes the property name from the string table in the bytecode | 12:58.33 |
| OP_SETPROP takes the property name from the stack | 12:58.38 |
avih | so the string table is of literals? or is it also some stack? | 13:06.25 |
| (or both?) | 13:06.37 |
ator | avih: see file jscompile.c function addstring() | 13:07.47 |
avih | thx | 13:07.56 |
ator | each compiled function holds a list of string constants | 13:08.12 |
| OP_SETPROP_S refers to this list | 13:08.26 |
avih | right, so big literal which is an aggregator of literals which stay throughout the runtime? | 13:09.02 |
| oh, a per function thing. ok. thx | 13:09.26 |
ator | all string constants used in a function are put into the string table | 13:09.30 |
avih | right | 13:09.37 |
ator | it's a per function table | 13:09.40 |
avih | thx. | 13:09.48 |
| what about the other two bugs i pointed? | 13:10.00 |
ator | fixed on my branch. | 13:10.08 |
avih | thx | 13:11.53 |
| "Nor should it call any functions that may throw exceptions." should also include "or even uses js_try" | 13:13.38 |
| (the report could be of exception-stack overflow) | 13:14.02 |
| "should read the top value and return true if it wants to handle the property." <- it's also allowed to modify it, like with js_tostring | 13:15.12 |
| (otherwise you're effectively asking the implementation to do js_dup) | 13:15.57 |
| ator: looks good, but missing docs to allow js_tostring et al on the top value. | 13:20.29 |
ator | I don't say the value must be left read-only. everywhere else you're allowed to js_tostring, don't see why this would be an exception. | 13:49.55 |
| and if I add permissive language to the docs there, giving that special case, you'll start wondering why I mention it there and nowhere else and you'll be paranoid and confused about everywhere else | 13:52.34 |
| and then the documentation explodes into a verbose mess | 13:52.42 |
avih | aye, valid argument. | 13:54.20 |
| ator: another approach is to make these callbacks js_CFunction, where `this' is idx 0 and the argument[s] are normal stack values. it should have negligible perf penalty, but it does change the API | 13:56.24 |
Biganon | Hi; I'm trying to install pymupdf using pip, but I get the following errors: https://0bin.net/paste/4QIeeumRc66g4bis#X1Ik14Fd7IM48XQEUyLc2LVI3l9Ou-7O3aw0GJbrCI4 | 14:50.49 |
| mmh, updating pip solved it. Sorry it's dumb, but pip not being up to date never caused me issues in the past | 14:52.25 |
ator | Biganon: pymupdf is not our project, so I'm afraid I won't be able to help you. | 15:13.10 |
| <<<Back 1 day (to 2020/03/16) | Forward 1 day (to 2020/03/18)>>> | |