Repository navigation
Conversation
|
Hello @boyxuper, thank you for the PR. Can you determine how it is that https://github.com/digitalbazaar/forge/blob/master/lib/util.js#L118 |
|
Yes, usePureJavaScript indicates a pure ES6 environment, which lack of |
|
Thanks for the additional detail. It sounds like to me that Based on this one line: https://github.com/digitalbazaar/forge/blob/master/lib/util.js#L123 return typeof self === 'undefined' ? window : self;I think adding the following conditional before L123 might work. // applicable for wechat miniapp runtime context
if(!(window || self)) {
return {};
}Which I believe would eliminate the need for the additional code changes you've made. |
|
This workaround is from this function And, maybe the detection for undefined variables, should be kept this way? I worried that change type of a variable maybe too much for this. |
fix compatibility in
usePureJavaScriptmode, which globalScope can be undefined