Files
codeql/javascript/ql/test/library-tests/frameworks/WebSocket/client.js
Owen Mansel-Chan 0eccd902c2 js: Inline expectation should have space after $
This was a regex-find-replace from `// \$(?! )` (using a negative lookahead) to `// $ `.
2026-03-04 12:45:03 +00:00

17 lines
450 B
JavaScript

const WebSocket = require('ws');
(function () {
const ws = new WebSocket('ws://example.org'); // $ clientSocket
ws.on('open', function open() {
ws.send('Hi from client!'); // $ clientSend
});
ws.on('message', function incoming(data) { // $ remoteFlow
console.log(data);
}); // $ clientReceive
})();
module.exports.MyWebSocketWS = require('ws');
module.exports.myWebSocketWSInstance = new WebSocket('ws://example.org'); // $ clientSocket