33// |
44// | (C) Mozilla Corp
55// | licensed under MPL 2.0 http://www.mozilla.org/MPL/
6- // \____________________________________________/
6+ // \____________________________________________/
77
88
99define ( '/trace/trace_server' , function ( require ) {
@@ -26,18 +26,18 @@ define('/trace/trace_server',function(require){
2626
2727 // the nodejs loader
2828 if ( process . argv [ 2 ] && process . argv [ 2 ] . indexOf ( '-l' ) == 0 ) return nodeLoader ( )
29-
30- function nodeLoader ( ) {
29+
30+ function nodeLoader ( ) {
3131 var filter = makeFilter ( process . argv [ 2 ] . slice ( 2 ) )
3232
3333 var m = require ( 'module' ) . Module . prototype ;
3434 var oldCompile = m . _compile ;
3535 var did = 1
3636 m . _compile = function ( content , filename ) {
3737
38- if ( filter . active && filter ( filename ) )
38+ if ( filter . active && filter ( filename ) )
3939 return oldCompile . call ( this , content , filename )
40- // lets instrument
40+ // lets instrument
4141 var t = instrument ( filename , content , did , filter . opt )
4242 did = t . id
4343 // send the dictionary out
@@ -81,7 +81,7 @@ define('/trace/trace_server',function(require){
8181 function init ( a ) {
8282 var d = [ ]
8383 for ( var i = 0 ; i < a . length ; i ++ ) {
84- if ( a [ i ] . charAt ( 0 ) == ':' ) d [ i ] = a [ i ] . slice ( 1 )
84+ if ( a [ i ] . charAt ( 0 ) == ':' ) d [ i ] = a [ i ] . slice ( 1 )
8585 else d [ i ] = new RegExp ( a [ i ] . slice ( 1 ) , "i" )
8686 }
8787 return d
@@ -105,7 +105,7 @@ define('/trace/trace_server',function(require){
105105
106106 f . opt = fspec . _opt
107107 f . active = _do . length || _no . length
108-
108+
109109 f . stringify = function ( ) {
110110 return JSON . stringify ( fspec )
111111 }
@@ -123,13 +123,13 @@ define('/trace/trace_server',function(require){
123123 define . settingsData = data
124124 define . settingsFile = file
125125 }
126- catch ( e ) {
126+ catch ( e ) {
127127 console . log ( "Error reading settings file (" + file + ") " , e )
128128 }
129129 }
130130
131- if ( ! loadSettings ( path . resolve ( process . cwd ( ) , "tracegl.json" ) ) &&
132- ! loadSettings ( "~/tracegl.json" ) &&
131+ if ( ! loadSettings ( path . resolve ( process . cwd ( ) , "tracegl.json" ) ) &&
132+ ! loadSettings ( "~/tracegl.json" ) &&
133133 ! loadSettings ( path . resolve ( path . dirname ( __filename ) , "tracegl.json" ) ) &&
134134 ! define . settings )
135135 loadSettings ( path . resolve ( path . dirname ( __filename ) , "tracegl.json" ) )
@@ -153,7 +153,7 @@ define('/trace/trace_server',function(require){
153153 out ( ' ~c~-gz[:trace.gz] ~w~Record trace to gzip file. No trace UI started\n' )
154154 out ( ' ~c~-do[/:]match ~w~Only trace filenames containing match. Filters -do set first, then -no\n' )
155155 out ( ' ~c~-no[/:]match ~w~Ignore filenames containing match. Replace : with / for a regexp, use double escaped \\\\ \n' )
156- out ( ' ~c~-nolib ~w~Short for -no/jquery.* -no:require.js -no/node\\\\_modules \n' )
156+ out ( ' ~c~-nolib ~w~Short for -no/jquery.* -no:require.js -no/node\\\\_modules -no/bower\\\\_components \n' )
157157 out ( ' ~c~-nocatch ~w~Don\'t create exception catching\n' )
158158 out ( ' ~c~-bind:0.0.0.0 ~w~Set the hostname to bind our external ports to, default 0.0.0.0\n' )
159159 out ( ' ~c~-ui:port ~w~Set trace UI port. default: 2000\n' )
@@ -188,6 +188,7 @@ define('/trace/trace_server',function(require){
188188 fspec . _no . push ( "/jquery.*" )
189189 fspec . _no . push ( ":require.js" )
190190 fspec . _no . push ( "/node\\_modules" )
191+ fspec . _no . push ( "/bower\\_components" )
191192 } else {
192193 fspec . _no . push ( a . slice ( 3 ) )
193194 }
@@ -272,7 +273,7 @@ define('/trace/trace_server',function(require){
272273 console . log ( "Building file find search db from " + root + " .." )
273274 scanHash = { }
274275 scan ( root , find )
275- }
276+ }
276277 else find ( )
277278 } else {
278279 var sf = path . resolve ( root , sp . join ( '/' ) )
@@ -290,7 +291,7 @@ define('/trace/trace_server',function(require){
290291 function openEditor ( file , line ) {
291292 var ed
292293 var s = define . settings
293- if ( ! s . editors ||
294+ if ( ! s . editors ||
294295 ! ( ed = s . editors [ process . platform ] ) )
295296 return console . log ( "No editor settings available for your platform" )
296297 // lets try all editors
@@ -331,7 +332,7 @@ define('/trace/trace_server',function(require){
331332
332333 var dict = [ ]
333334 var queue = [ ]
334- var joined = false
335+ var joined = false
335336
336337 var finder = fileFinder ( process . cwd ( ) )
337338
@@ -393,13 +394,13 @@ define('/trace/trace_server',function(require){
393394 fstr . on ( 'error' , function ( err ) {
394395 console . log ( "Error writing " + file + " " + err )
395396 } )
396-
397+
397398 gz . on ( 'error' , function ( err ) {
398399 console . log ( "Error zipping " + file + " " + err )
399400 } )
400401
401402 gz . pipe ( fstr )
402-
403+
403404 var buf = [ ]
404405 var total = 0
405406
@@ -459,10 +460,10 @@ define('/trace/trace_server',function(require){
459460 tgt . data = function ( m , c ) {
460461 sender ( m )
461462 }
462-
463- var fileCache = { }
463+
464+ var fileCache = { }
464465 var did = 1 // count instrument offset id
465-
466+
466467 tgt . fileChange = function ( f ) {
467468 // lets flush everything
468469 fileCache = { }
@@ -511,7 +512,7 @@ define('/trace/trace_server',function(require){
511512 args . unshift ( file )
512513 args . unshift ( '-l' + filter . stringify ( ) )
513514 args . unshift ( process . argv [ 1 ] )
514-
515+
515516 var stdio = [ process . stdin , process . stdout , 'pipe' ]
516517 //if(process.version.indexOf('v0.8') != -1) stdio.push('ipc')
517518
@@ -529,7 +530,7 @@ define('/trace/trace_server',function(require){
529530 child . on ( 'message' , function ( m ) {
530531 sender ( m )
531532 } )
532-
533+
533534 child . on ( 'exit' , function ( ) {
534535 sender ( false ) ;
535536 } )
@@ -549,8 +550,8 @@ define('/trace/trace_server',function(require){
549550 tgt . data = function ( m , c ) {
550551 sender ( m )
551552 }
552-
553- var fileCache = { }
553+
554+ var fileCache = { }
554555 var did = 1 // count instrument offset id
555556 tgt . process = function ( file , data , type ) {
556557 if ( type != "application/javascript" ) return data
@@ -585,6 +586,7 @@ define('/trace/trace_server',function(require){
585586 } )
586587 }
587588} )
589+
588590function define ( id , fac ) {
589591//PACKSTART
590592 // | returns path of file
0 commit comments