diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -1194,7 +1194,7 @@ var CodeMirror = (function() {
       from = clipPos(from); to = clipPos(to);
       var tm = new TextMarker();
       function add(line, from, to, className) {
-        mark = getLine(line).addMark(new MarkedText(from, to, className, tm.set));
+        getLine(line).addMark(new MarkedText(from, to, className, tm.set));
       }
       if (from.line == to.line) add(from.line, from.ch, to.ch, className);
       else {
"mark" is neither declared, nor used.