Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1030264 // js_evalOnWebSocketMessage

JavaX fragment (include)

sS js_evalOnWebSocketMessage() {
  ret [[
    function(event) {
      var data = JSON.parse(event.data);
      if (data.eval) {
        if (wsVerbose) console.log("Evaluating: " + data.eval);
        var geval = eval; // use global scope
        geval(data.eval);
        if (wsVerbose) console.log("Evaluated.");
      } else
        if (wsVerbose) console.log("WebSocket incoming: " + event.data);
    }
  ]];
}

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030264
Snippet name: js_evalOnWebSocketMessage
Eternal ID of this version: #1030264/8
Text MD5: 7fea7358813edb85a05c0dc07fa40237
Author: stefan
Category: javax / html
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-18 17:49:10
Source code size: 426 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 170 / 208
Version history: 7 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)