MCPcopy Create free account
hub / github.com/totaljs/framework / view_insert_call

Function view_insert_call

internal.js:2366–2397  ·  view source on GitHub ↗
(command)

Source from the content-addressed store, hash-verified

2364}
2365
2366function view_insert_call(command) {
2367
2368 var beg = command.indexOf('(');
2369 if (beg === -1)
2370 return command;
2371
2372 var length = command.length;
2373 var count = 0;
2374
2375 for (var i = beg + 1; i < length; i++) {
2376
2377 var c = command[i];
2378
2379 if (c !== '(' && c !== ')')
2380 continue;
2381
2382 if (c === '(') {
2383 count++;
2384 continue;
2385 }
2386
2387 if (count > 0) {
2388 count--;
2389 continue;
2390 }
2391
2392 var arg = command.substring(beg + 1);
2393 return command.substring(0, beg) + '.call(self' + (arg.length > 1 ? ',' + arg : ')');
2394 }
2395
2396 return command;
2397}
2398
2399function view_is_assign(value) {
2400

Callers 1

view_prepareFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected