cmark

My personal build of CMark ✏️

Commit
1aba0ee439a79078e3d641befb979877f77ac334
Parent
5fbd73cc31627b125c59f98a5de41e6442235ea7
Author
John MacFarlane <jgm@berkeley.edu>
Date

More eslint corrections.

Diffstat

1 file changed, 6 insertions, 5 deletions

Status File Name N° Changes Insertions Deletions
Modified js/lib/from-code-point.js 11 6 5
diff --git a/js/lib/from-code-point.js b/js/lib/from-code-point.js
@@ -1,8 +1,8 @@
 // derived from https://github.com/mathiasbynens/String.fromCodePoint
 /*! http://mths.be/fromcodepoint v0.2.1 by @mathias */
 if (String.fromCodePoint) {
-
     module.exports = function (_) {
+        "use strict";
         try {
             return String.fromCodePoint(_);
         } catch (e) {
@@ -11,13 +11,14 @@ if (String.fromCodePoint) {
             }
             throw e;
         }
-    }
+    };
 
 } else {
 
   var stringFromCharCode = String.fromCharCode;
   var floor = Math.floor;
-  var fromCodePoint = function(_) {
+  var fromCodePoint = function() {
+      "use strict";
       var MAX_SIZE = 0x4000;
       var codeUnits = [];
       var highSurrogate;
@@ -34,7 +35,7 @@ if (String.fromCodePoint) {
               !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
                   codePoint < 0 || // not a valid Unicode code point
                   codePoint > 0x10FFFF || // not a valid Unicode code point
-                  floor(codePoint) != codePoint // not an integer
+                  floor(codePoint) !== codePoint // not an integer
           ) {
               return String.fromCharCode(0xFFFD);
           }
@@ -47,7 +48,7 @@ if (String.fromCodePoint) {
               lowSurrogate = (codePoint % 0x400) + 0xDC00;
               codeUnits.push(highSurrogate, lowSurrogate);
           }
-          if (index + 1 == length || codeUnits.length > MAX_SIZE) {
+          if (index + 1 === length || codeUnits.length > MAX_SIZE) {
               result += stringFromCharCode.apply(null, codeUnits);
               codeUnits.length = 0;
           }