소스 검색

Merge pull request #19036 from Mugen87/dev45

Global: Clean up.
Mr.doob 5 년 전
부모
커밋
ea9b4a9cc2

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

@@ -544,7 +544,7 @@
 
     d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px";
     d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px";
-    d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"
+    d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent";
 
     if (sizes.right && sizes.bottom) {
       d.scrollbarFiller.style.display = "block";
@@ -1260,7 +1260,7 @@
       });
 
       function prepareCopyCut(e) {
-        if (signalDOMEvent(cm, e)) return
+        if (signalDOMEvent(cm, e)) return;
         if (cm.somethingSelected()) {
           lastCopied = cm.getSelections();
           if (input.inaccurateSelection) {
@@ -1485,8 +1485,8 @@
         operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll);
 
       var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;
-      input.wrapper.style.cssText = "position: absolute"
-      var wrapperBox = input.wrapper.getBoundingClientRect()
+      input.wrapper.style.cssText = "position: absolute";
+      var wrapperBox = input.wrapper.getBoundingClientRect();
       te.style.cssText = "position: absolute; width: 30px; height: 30px; top: " + (e.clientY - wrapperBox.top - 5) +
         "px; left: " + (e.clientX - wrapperBox.left - 5) + "px; z-index: 1000; background: " +
         (ie ? "rgba(255, 255, 255, .05)" : "transparent") +
@@ -1576,7 +1576,7 @@
 
       on(div, "paste", function(e) {
         if (!signalDOMEvent(cm, e)) handlePaste(e, cm);
-      })
+      });
 
       on(div, "compositionstart", function(e) {
         var data = e.data;
@@ -1619,7 +1619,7 @@
       });
 
       function onCopyCut(e) {
-        if (signalDOMEvent(cm, e)) return
+        if (signalDOMEvent(cm, e)) return;
         if (cm.somethingSelected()) {
           lastCopied = cm.getSelections();
           if (e.type == "cut") cm.replaceSelection("", null, "cut");
@@ -3906,7 +3906,7 @@
     if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
 
     e.dataTransfer.setData("Text", cm.getSelection());
-    e.dataTransfer.effectAllowed = "copyMove"
+    e.dataTransfer.effectAllowed = "copyMove";
 
     // Use dummy image instead of default browsers image.
     // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
@@ -7099,7 +7099,7 @@
       if (nextChange == pos) { // Update current marker set
         spanStyle = spanEndStyle = spanStartStyle = title = css = "";
         collapsed = null; nextChange = Infinity;
-        var foundBookmarks = [], endStyles
+        var foundBookmarks = [], endStyles;
         for (var j = 0; j < spans.length; ++j) {
           var sp = spans[j], m = sp.marker;
           if (m.type == "bookmark" && sp.from == pos && m.widgetNode) {
@@ -7112,7 +7112,7 @@
             if (m.className) spanStyle += " " + m.className;
             if (m.css) css = (css ? css + ";" : "") + m.css;
             if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
-            if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to)
+            if (m.endStyle && sp.to == nextChange) (endStyles || (endStyles = [])).push(m.endStyle, sp.to);
             if (m.title && !title) title = m.title;
             if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
               collapsed = sp;
@@ -7121,7 +7121,7 @@
           }
         }
         if (endStyles) for (var j = 0; j < endStyles.length; j += 2)
-          if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j]
+          if (endStyles[j + 1] == nextChange) spanEndStyle += " " + endStyles[j];
 
         if (!collapsed || collapsed.from == pos) for (var j = 0; j < foundBookmarks.length; ++j)
           buildCollapsedSpan(builder, 0, foundBookmarks[j]);
@@ -8181,7 +8181,7 @@
   };
 
   var signal = CodeMirror.signal = function(emitter, type /*, values...*/) {
-    var handlers = getHandlers(emitter, type, true)
+    var handlers = getHandlers(emitter, type, true);
     if (!handlers.length) return;
     var args = Array.prototype.slice.call(arguments, 2);
     for (var i = 0; i < handlers.length; ++i) handlers[i].apply(null, args);
@@ -8297,7 +8297,7 @@
       pos = nextTab + 1;
       if (col >= goal) return pos;
     }
-  }
+  };
 
   var spaceStrs = [""];
   function spaceStr(n) {

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

@@ -365,7 +365,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     if (type == "class") return cont(pushlex("form"), className, poplex);
     if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
     if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
-    if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex)
+    if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex);
     return pass(pushlex("stat"), expression, expect(";"), poplex);
   }
   function expression(type) {

+ 4 - 5
editor/js/libs/jsonlint.js

@@ -4,7 +4,7 @@
 //
 // Copyright (C) 2012 Zachary Carter
 //
-// Permission is hereby granted, free of charge, to any person obtaining a 
+// Permission is hereby granted, free of charge, to any person obtaining a
 // copy of this software and associated documentation files (the "Software"),
 // to deal in the Software without restriction, including without limitation
 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
@@ -41,7 +41,7 @@ case 1: // replace escaped characters with actual character
                      .replace(/\\v/g,'\v')
                      .replace(/\\f/g,'\f')
                      .replace(/\\b/g,'\b');
-        
+
 break;
 case 2:this.$ = Number(yytext);
 break;
@@ -260,7 +260,6 @@ parse: function parse(input) {
 
     }
 
-    return true;
 }};
 /* Jison generated lexer */
 var lexer = (function(){
@@ -349,7 +348,7 @@ next:function () {
             this.yylloc = {first_line: this.yylloc.last_line,
                            last_line: this.yylineno+1,
                            first_column: this.yylloc.last_column,
-                           last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length}
+                           last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length};
             this.yytext += match[0];
             this.match += match[0];
             this.yyleng = this.yytext.length;
@@ -364,7 +363,7 @@ next:function () {
         if (this._input === "") {
             return this.EOF;
         } else {
-            this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(), 
+            this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
                     {text: "", token: null, line: this.yylineno});
         }
     },

+ 0 - 1
editor/js/libs/ternjs/def.js

@@ -166,7 +166,6 @@
       } else if (this.eat("+")) {
         var path = this.word(/[\w$<>\.!]/);
         var base = parsePath(path + ".prototype");
-        var type;
         if (!(base instanceof infer.Obj)) base = parsePath(path);
         if (!(base instanceof infer.Obj)) return base;
         if (comp && this.eat("[")) return this.parsePoly(base);

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

@@ -951,7 +951,7 @@
     var expr = findExprOrThrow(file, query, true);
     if (expr.node.type == "Identifier") {
       return findRefsToVariable(srv, query, file, expr);
-    } else if (expr && expr.node.type == "MemberExpression" && !expr.node.computed) {
+    } else if (expr.node.type == "MemberExpression" && !expr.node.computed) {
       var p = expr.node.property;
       expr.node = expr.node.object;
       return findRefsToProperty(srv, query, expr, p);

+ 1 - 2
examples/js/loaders/FBXLoader.js

@@ -3294,8 +3294,7 @@ THREE.FBXLoader = ( function () {
 			var endOffset = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();
 			var numProperties = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();
 
-			// note: do not remove this even if you get a linter warning as it moves the buffer forward
-			var propertyListLen = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();
+			( version >= 7500 ) ? reader.getUint64() : reader.getUint32(); // the returned propertyListLen is not used
 
 			var nameLen = reader.getUint8();
 			var name = reader.getString( nameLen );

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

@@ -226,7 +226,7 @@ THREE.RGBELoader.prototype = Object.assign( Object.create( THREE.DataTextureLoad
 
 				data_rgba = new Uint8Array( 4 * w * h );
 
-				if ( ! data_rgba || ! data_rgba.length ) {
+				if ( ! data_rgba.length ) {
 
 					return rgbe_error( rgbe_memory_error, "unable to allocate buffer space" );
 

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

@@ -532,7 +532,7 @@ THREE.TGALoader.prototype = Object.assign( Object.create( THREE.Loader.prototype
 		var imageData = context.createImageData( header.width, header.height );
 
 		var result = tgaParse( use_rle, use_pal, header, offset, content );
-		var rgbaData = getTgaRGBA( imageData.data, header.width, header.height, result.pixel_data, result.palettes );
+		getTgaRGBA( imageData.data, header.width, header.height, result.pixel_data, result.palettes );
 
 		context.putImageData( imageData, 0, 0 );
 

+ 1 - 2
examples/jsm/loaders/FBXLoader.js

@@ -3341,8 +3341,7 @@ var FBXLoader = ( function () {
 			var endOffset = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();
 			var numProperties = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();
 
-			// note: do not remove this even if you get a linter warning as it moves the buffer forward
-			var propertyListLen = ( version >= 7500 ) ? reader.getUint64() : reader.getUint32();
+			( version >= 7500 ) ? reader.getUint64() : reader.getUint32(); // the returned propertyListLen is not used
 
 			var nameLen = reader.getUint8();
 			var name = reader.getString( nameLen );

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

@@ -239,7 +239,7 @@ RGBELoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
 
 				data_rgba = new Uint8Array( 4 * w * h );
 
-				if ( ! data_rgba || ! data_rgba.length ) {
+				if ( ! data_rgba.length ) {
 
 					return rgbe_error( rgbe_memory_error, "unable to allocate buffer space" );
 

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

@@ -538,7 +538,7 @@ TGALoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 		var imageData = context.createImageData( header.width, header.height );
 
 		var result = tgaParse( use_rle, use_pal, header, offset, content );
-		var rgbaData = getTgaRGBA( imageData.data, header.width, header.height, result.pixel_data, result.palettes );
+		getTgaRGBA( imageData.data, header.width, header.height, result.pixel_data, result.palettes );
 
 		context.putImageData( imageData, 0, 0 );