MCPcopy Create free account
hub / github.com/Canop/codesort / test_balance_javascript

Function test_balance_javascript

src/analyzers/javascript.rs:116–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114
115#[test]
116fn test_balance_javascript() {
117 let code = r#"
118 // called by the server or (most often) in case of any action on a message
119 // (so this is very frequently called on non pings)
120 notif.removePing = function(mid, forwardToServer, flash){
121 if (!mid) return;
122 // we assume here there's at most one notification to a given message
123 for (var i=0; i<notifications.length; i++) {
124 if (notifications[i].mid==mid) {
125 if (flash) {
126 var $md = $('#messages .message[mid='+mid+']');
127 if ($md.length) {
128 md.goToMessageDiv($md);
129 }
130 }
131 if (forwardToServer) ws.emit("rm_ping", mid);
132 notifications.splice(i, 1);
133 notif.updatePingsList();
134 return;
135 }
136 }
137 }
138 "#;
139 let list = LocList::read_str(code, Language::Javascript).unwrap();
140 assert!(list.is_complete());
141}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected