diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-13 22:43:21 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-13 22:43:21 -0800 |
commit | daf49a0089b9f5e342d3f6ee077d7e284eeb5c1c (patch) | |
tree | 9be254364afe3c558ee10ed9e8f7a78df997b116 /js/lib/blocks.js | |
parent | 53d6785139fb9f4642d4bc3d48918fbf6f33621d (diff) |
blocks.js - avoid an implicit boolean cast.
Diffstat (limited to 'js/lib/blocks.js')
-rw-r--r-- | js/lib/blocks.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/js/lib/blocks.js b/js/lib/blocks.js index 86064b5..d53a82f 100644 --- a/js/lib/blocks.js +++ b/js/lib/blocks.js @@ -65,10 +65,10 @@ var detabLine = function(text) { // Return index of match or -1. var matchAt = function(re, s, offset) { var res = s.slice(offset).match(re); - if (res) { - return offset + res.index; - } else { + if (res === null) { return -1; + } else { + return offset + res.index; } }; |