And, I won’t lie to you, this is probably the most frustrating episode in the series so far. I really didn’t make much headway.
But the Gecko profiler backend is written entirely in C++, and so that’s where I’d have to create the Promise.
A few weeks back, I posted a “Things I’ve learned this week” about how to create DOM Promises in C++. That’s all well and good, but creating the Promise is only half of the job. You have to resolve (or reject) the Promise in order for it to be useful at all.
The way I wanted to resolve the Promise involved parsing a JSON string and resolving with the resulting object.
That turned out to be a lot harder than I thought it’d be. Watch the video to see why. Suffice it to say, I spend a lot of it asking for help in IRC. It’s a 100% accurate demonstration of what I do when I’m lost, or can’t figure something out, and I need help.
Since I recorded this episode, I’ve figured out what I needed to do – I’ve posted a “Things I’ve learned this week” containing that information. Hopefully that’ll help somebody else in the future!