help.lint.checks: Save lint disposables in hash.
parent
79db3ca594
commit
e5bd5f6719
|
@ -4,10 +4,10 @@ USING: accessors arrays assocs classes classes.struct
|
||||||
classes.tuple combinators combinators.short-circuit
|
classes.tuple combinators combinators.short-circuit
|
||||||
combinators.smart continuations debugger definitions effects
|
combinators.smart continuations debugger definitions effects
|
||||||
eval formatting fry grouping help help.markup help.topics io
|
eval formatting fry grouping help help.markup help.topics io
|
||||||
io.streams.string kernel macros math namespaces parser.notes
|
io.streams.string kernel macros math math.statistics namespaces
|
||||||
prettyprint sequences sequences.deep sets splitting strings
|
parser.notes prettyprint sequences sequences.deep sets splitting
|
||||||
summary tools.destructors unicode vocabs vocabs.loader words
|
strings summary tools.destructors unicode vocabs vocabs.loader
|
||||||
words.constant words.symbol ;
|
words words.constant words.symbol ;
|
||||||
IN: help.lint.checks
|
IN: help.lint.checks
|
||||||
|
|
||||||
ERROR: simple-lint-error message ;
|
ERROR: simple-lint-error message ;
|
||||||
|
@ -50,9 +50,13 @@ SYMBOL: vocab-articles
|
||||||
] keep
|
] keep
|
||||||
last assert=
|
last assert=
|
||||||
] vocabs-quot get call( quot -- )
|
] vocabs-quot get call( quot -- )
|
||||||
] leaks members no-ui-disposables length [
|
] leaks members no-ui-disposables
|
||||||
"%d disposable(s) leaked in example" sprintf simple-lint-error
|
dup length 0 > [
|
||||||
] unless-zero ;
|
dup [ class-of ] histogram-by
|
||||||
|
[ "Leaked resources: " write ... ] with-string-writer simple-lint-error
|
||||||
|
] [
|
||||||
|
drop
|
||||||
|
] if ;
|
||||||
|
|
||||||
: check-examples ( element -- )
|
: check-examples ( element -- )
|
||||||
\ $example swap elements [ check-example ] each ;
|
\ $example swap elements [ check-example ] each ;
|
||||||
|
|
Loading…
Reference in New Issue