possible assert issue when running under different nodejs vm contexts
See original GitHub issueThe line at https://github.com/crossbario/autobahn-js/blob/d0d34813110f64127b2b76ecfa7eba7adda5a430/packages/autobahn/lib/session.js#L1217 fails for me on NodeJS 11 and 12, even though the kwargs parameter is an object.
I gave up debugging when seeing these watch values:
It’s not necessarily an autobahn related issue, but if I change those (and all related) checks to kwargs typeof === 'object'
, everything works fine.
I’ve seen you already had trouble with the array checks a while back, is there any chance to use typeof for the object checks aswell? I could create a PR for it!
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Evaluate node core modules within a vm.Context #31852
js to run the corresponding setups and create a different set of builtins for the context (from the top of my head, it...
Read more >VM (executing JavaScript) | Node.js v19.3.0 Documentation
A common use case is to run the code in a different V8 Context. This means invoked code has a different global object...
Read more >Assert | Node.js v19.3.0 Documentation
In strict assertion mode, non-strict methods behave like their corresponding strict methods. For example, assert.deepEqual() will behave like assert.
Read more >Errors | Node.js v19.3.0 Documentation
AssertionError s are a special class of error that can be triggered when Node.js detects an exceptional logic violation that should never occur....
Read more >Node.js v19.3.0 Documentation
Report errors in this documentation in the issue tracker. ... Using assert.fail() with more than two arguments is possible but deprecated.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That sounds reasonable.
Up to now we have worked around the “instanceof” problem by creating the object outside the VM. But a clean solution to this would be really appreciated.
We don’t use that particular contrib node. It didn’t exist back then, so we developed our own with some more advanced features.
BTW: We have been using WAMP in conjunction with Node-RED for many years now. Quite the couple these two technologies. 😄
yeah, PR looked good, so merged! the issue should hence be fixed (on master)
also, no, we don’t have a contribution guide (we should … but in any case, you basically blended in code style etc into what’s there already, so cool)