Skip to content

Commit

Permalink
avoid unwanted script evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed May 26, 2012
1 parent 09a77ef commit 7f229c4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
4 changes: 2 additions & 2 deletions doctest.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ fetch = (url) ->
url = $script.attr('src').replace(/doctest[.]js$/, url)

console.log "retrieving #{url}..."
jQuery.get url, (text) ->
jQuery.ajax url, dataType: 'text', success: (text) ->
results = test text
console.log "running doctests in #{url}..."
console.log ((if pass then '.' else 'x') for [pass] in results).join ''
for [pass, expected, actual, num] in (r for r in results when not r[0])
console.warn "expected #{expected} on line #{num} (got #{actual})"

window.doctest.version = '0.1.2'
window.doctest.version = '0.1.3'

commented_lines = (text) ->
lines = []
Expand Down
59 changes: 31 additions & 28 deletions doctest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7f229c4

Please sign in to comment.