Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
merge
Commit Description:
merge
var test = require ( 'tape' )
var src = require ( 'fs' ). readFileSync ( require . resolve ( 'acorn' ))
var parse = require ( 'acorn' ). parse
var dash = require ( '../' )
var NUM_NODES = 25426
test ( 'dash-ast' , function ( t ) {
var ast = parse ( src )
var i = 0
dash ( ast , function ( node ) { i ++ })
t . equal ( i , NUM_NODES )
t . comment ( 'walked ' + i + ' nodes' )
t . end ()
})
test ( 'dash-ast with .parent' , function ( t ) {
var ast = parse ( src )
var i = 0
dash . withParent ( ast , function ( node ) { i ++ })
t . equal ( i , NUM_NODES )
t . comment ( 'walked ' + i + ' nodes' )
t . end ()
})
test ( 'dash-ast with enter/leave' , function ( t ) {
var ast = parse ( src )
var i = 0
var j = 0
dash ( ast , {
enter : function ( node ) { i ++ },
leave : function ( node ) { j ++ }
})
t . equal ( i , NUM_NODES )
t . equal ( j , NUM_NODES )
t . comment ( 'walked ' + [ i , j ] + ' nodes' )
t . end ()
})
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings