浏览代码

lgtm regexp fixes

makc 5 年之前
父节点
当前提交
422294f771

+ 1 - 1
editor/js/libs/codemirror/codemirror.js

@@ -6752,7 +6752,7 @@
       var prop = lineClass[1] ? "bgClass" : "textClass";
       if (output[prop] == null)
         output[prop] = lineClass[2];
-      else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop]))
+      else if (!(new RegExp("(?:^|\\s)" + lineClass[2] + "(?:$|\\s)")).test(output[prop]))
         output[prop] += " " + lineClass[2];
     }
     return type;

+ 1 - 1
editor/js/libs/ternjs/doc_comment.js

@@ -325,7 +325,7 @@
 
     for (var i = 0; i < comments.length; ++i) {
       var comment = comments[i];
-      var decl = /(?:\n|$|\*)\s*@(type|param|arg(?:ument)?|returns?|this)\s+(.*)/g, m;
+      var decl = /(?:\n|\$|\*)\s*@(type|param|arg(?:ument)?|returns?|this)\s+(.*)/g, m;
       while (m = decl.exec(comment)) {
         if (m[1] == "this" && (parsed = parseType(scope, m[2], 0))) {
           self = parsed;

+ 1 - 1
examples/js/loaders/MMDLoader.js

@@ -1284,7 +1284,7 @@ THREE.MMDLoader = ( function () {
 
 				try {
 
-					index = parseInt( filePath.match( 'toon([0-9]{2})\.bmp$' )[ 1 ] );
+					index = parseInt( filePath.match( /toon([0-9]{2})\.bmp$/ )[ 1 ] );
 
 				} catch ( e ) {
 

+ 1 - 1
examples/jsm/loaders/MMDLoader.js

@@ -1320,7 +1320,7 @@ var MMDLoader = ( function () {
 
 				try {
 
-					index = parseInt( filePath.match( 'toon([0-9]{2})\.bmp$' )[ 1 ] );
+					index = parseInt( filePath.match( /toon([0-9]{2})\.bmp$/ )[ 1 ] );
 
 				} catch ( e ) {