File: fnentry

package info (click to toggle)
edbrowse 3.8.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,992 kB
  • sloc: ansic: 48,603; javascript: 16,211; perl: 6,825; sh: 120; makefile: 81; cpp: 56
file content (17 lines) | stat: -rwxr-xr-x 582 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl

# Put entry debug statements on functions
# usage fnentry file.js >temp.js
# intended for shared.js and startwindow.js, and only for debugging purposes

open FH, $ARGV[0];
while(<FH>) {
# "foo", function(params) {
# for swm and sdm in startwindow
s/"([\w\$]+)", *function *\(([\w\$, ]*)\) *{$/"$1", function($2) {alert3("enter $1");/;
# foo = function(params) {
s/([\w\$]+) = function *\(([\w\$, ]*)\) *{$/$1 = function($2) {alert3("enter $1");/;
# function foo(params) {
s/\bfunction +([\w\$]+) *\(([\w\$, ]*)\) *{$/function $1($2) {alert3("enter $1");/;
print;
}