I think "d1 == d2" checks whether d1 and d2 actually refer to the same JS object. Therefore JavascriptInterop::WrapObject needs to return the same JS object every time it's called with the same .NET object as the argument, until that JS object is removed via GC. So basically you need a dictionary that maps .NET objects to JS objects but doesn't interfere with GC on either side. I'm guessing you'll need one of these per JavascriptContext. Good luck!
↧