IRC Log Viewer » #firebreath » 2015-04-27

IRC Nick Time (GMT-7) Message
taxilian 09:04 good morning all
walter_ I'm around now
walter_ I'm around now
walter_ 09:04 HI taxilian
taxilian 09:04 how's things?
walter_ 09:04 fine, thx.... I'm struggling with variantPromise right now.... quite basic stuff
I'm passing from JS array in array, sth like: [ ['a', 'b'], ['c', 'd'] ]
As we talked before - I can't directly convert_cast - I had to use Promises
writeFileDialog(const FB::VariantList& filters)
thats the function
for (int i = 0; i < filters.size(); i++) { .. }
and inside this loop:
filters[i].convert_cast<FB::VariantList>().then<FB::variant>([](FB::VariantList filter) -> FB::variant { ... }
When used from JS - I'm receiving failed, with this message:
When used from JS - I'm receiving failed, with this message:
<-- {"c":1,"cmdId":5,"colonyId":0,"msg":"[\"error\",{\"error\":\"Command threw an exception\",\"message\":\"bad cast\"}]","n":1,"type":"resp"}
could you pls look at this?
taxilian 10:04 can you give me that in a gist so I can see it easier?
bad_cast means that an argument you attempted to cast was not valid
also, have you attached a debugger to see where the exception is actually being thrown?
walter_ 10:04 https://gist.github.com/wojwal/b2009081d921076194b9
https://gist.github.com/wojwal/b2009081d921076194b9
filters[i].convert_cast<FB::VariantList>().then<FB::variant>([](FB::VariantList filter) -> FB::variant
it happens on this cast
it happens on this cast
taxilian 10:04 and how is the function being called?
walter_ 10:04 via firewyrm
via firewyrm
plugin.writeFileDialog([["name", "ext"], ["name2", "ext2"]]).then(function(succ) { ... })
JS from Chrome extension
taxilian 10:04 that's what I was looking for
that's what I was looking for
what are you actually trying to do here?
because you know that this doesn't actually do anything, right?
walter_ 10:04 I want to pass as parameter: [["name", "ext"], ["name2", "ext2"]]
taxilian 10:04 that part I figured out, but you're not using it for anything
walter_ 10:04 yeah, that was just dummy sample to show you casting
taxilian 10:04 if you can put together a simple empty project that repros this I can look at it
I need to run right now, but does this only need to work w/ FireWyrm?
if so, you can use FireWyrmJS.byVal(..) around the argument and it will pass it as a VariantList
be back in probably 30 min
walter_ 10:04 I also need NPAPI
taxilian 10:04 back
so I'd have to step through it to see exactly what is happening; it might be a bug, it might not. it's hard to say
taxilian 10:04 walter_: it's possible that there is a bug in convert_cast; the convert_cast code has definitely been redone in fb2
walter_ 10:04 taxilian, let me know if you can make it working
I'm just trying to pass 2 level data (array in array) - it might be multi level JSON object... etc... --- The only thing is that I want to read it - and then continue with it...
previously I was just casting it, like:
FB::VariantList filter = filters[i].convert_cast<FB::VariantList>();
and thats i
taxilian 10:04 right. the problem is that before that was a synchronous operation, but now it isn't
right. the problem is that before that was a synchronous operation, but now it isn't
walter_ 10:04 now - since filters[i] -- requires promise
taxilian 10:04 you understand why?
walter_ 10:04 I wanted to run all promisses in loop - and then use FB::whenAllPromises
to wait when all promisses are completed - and then continue my code
to wait when all promisses are completed - and then continue my code
hehe, but I'm stuced at first thing - to run promise inside the loop
hehe, but I'm stuced at first thing - to run promise inside the loop
taxilian 10:04 makes sense
walter_ 10:04 I used promises with JS - so I'm clear about it... It's just this convert that doesn't work
taxilian 10:04 right. these are the changes that were needed that will take us all a bit of tinkering to figure out the best way to deal with
taxilian 11:04 having trouble with my windows VM :-/
having trouble with my windows VM :-/
walter_ 11:04 ohh, you are not Windows user?
taxilian 11:04 not any more than I can help it
I used to be
walter_ 11:04 run it on your system then... Just remove those MessageBox - and include windows.h
taxilian 11:04 but I got over it =]
there we go... working again
I need my windows vm anyway
I have a lot I have to get done today, and half of it is on windows
be back in a few
building it while I'm gone
taxilian 16:04 walter_ in case you check this, those commits fix the issue.
jacquesolivierha 20:04 Hi there