Skip to content

Commit cdcdde9

Browse files
committed
Reverted console.* to THREE.* change. See mrdoob#5791.
1 parent fdf8022 commit cdcdde9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+204
-211
lines changed

src/Three.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ if ( Math.sign === undefined ) {
2626

2727
}
2828

29-
30-
// set the default log handlers
31-
THREE.log = function() { console.log.apply( console, arguments ); };
32-
THREE.warn = function() { console.warn.apply( console, arguments ); };
33-
THREE.error = function() { console.error.apply( console, arguments ); };
34-
35-
3629
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
3730

3831
THREE.MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
@@ -208,33 +201,33 @@ THREE.RGBA_PVRTC_2BPPV1_Format = 2103;
208201

209202
THREE.Projector = function () {
210203

211-
THREE.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );
204+
console.error( 'THREE.Projector has been moved to /examples/js/renderers/Projector.js.' );
212205

213206
this.projectVector = function ( vector, camera ) {
214207

215-
THREE.warn( 'THREE.Projector: .projectVector() is now vector.project().' );
208+
console.warn( 'THREE.Projector: .projectVector() is now vector.project().' );
216209
vector.project( camera );
217210

218211
};
219212

220213
this.unprojectVector = function ( vector, camera ) {
221214

222-
THREE.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );
215+
console.warn( 'THREE.Projector: .unprojectVector() is now vector.unproject().' );
223216
vector.unproject( camera );
224217

225218
};
226219

227220
this.pickingRay = function ( vector, camera ) {
228221

229-
THREE.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' );
222+
console.error( 'THREE.Projector: .pickingRay() is now raycaster.setFromCamera().' );
230223

231224
};
232225

233226
};
234227

235228
THREE.CanvasRenderer = function () {
236229

237-
THREE.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );
230+
console.error( 'THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js' );
238231

239232
this.domElement = document.createElement( 'canvas' );
240233
this.clear = function () {};

src/core/BufferAttribute.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -276,64 +276,64 @@ THREE.BufferAttribute.prototype = {
276276

277277
THREE.Int8Attribute = function ( data, itemSize ) {
278278

279-
THREE.warn( 'THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
279+
console.warn( 'THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
280280
return new THREE.BufferAttribute( data, itemSize );
281281

282282
};
283283

284284
THREE.Uint8Attribute = function ( data, itemSize ) {
285285

286-
THREE.warn( 'THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
286+
console.warn( 'THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
287287
return new THREE.BufferAttribute( data, itemSize );
288288

289289
};
290290

291291
THREE.Uint8ClampedAttribute = function ( data, itemSize ) {
292292

293-
THREE.warn( 'THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
293+
console.warn( 'THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
294294
return new THREE.BufferAttribute( data, itemSize );
295295

296296

297297
};
298298

299299
THREE.Int16Attribute = function ( data, itemSize ) {
300300

301-
THREE.warn( 'THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
301+
console.warn( 'THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
302302
return new THREE.BufferAttribute( data, itemSize );
303303

304304
};
305305

306306
THREE.Uint16Attribute = function ( data, itemSize ) {
307307

308-
THREE.warn( 'THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
308+
console.warn( 'THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
309309
return new THREE.BufferAttribute( data, itemSize );
310310

311311
};
312312

313313
THREE.Int32Attribute = function ( data, itemSize ) {
314314

315-
THREE.warn( 'THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
315+
console.warn( 'THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
316316
return new THREE.BufferAttribute( data, itemSize );
317317

318318
};
319319

320320
THREE.Uint32Attribute = function ( data, itemSize ) {
321321

322-
THREE.warn( 'THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
322+
console.warn( 'THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
323323
return new THREE.BufferAttribute( data, itemSize );
324324

325325
};
326326

327327
THREE.Float32Attribute = function ( data, itemSize ) {
328328

329-
THREE.warn( 'THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
329+
console.warn( 'THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
330330
return new THREE.BufferAttribute( data, itemSize );
331331

332332
};
333333

334334
THREE.Float64Attribute = function ( data, itemSize ) {
335335

336-
THREE.warn( 'THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
336+
console.warn( 'THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead.' );
337337
return new THREE.BufferAttribute( data, itemSize );
338338

339339
};

src/core/BufferGeometry.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ THREE.BufferGeometry.prototype = {
3131

3232
if ( attribute instanceof THREE.BufferAttribute === false && attribute instanceof THREE.InterleavedBufferAttribute === false ) {
3333

34-
THREE.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );
34+
console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );
3535

3636
this.attributes[ name ] = { array: arguments[ 1 ], itemSize: arguments[ 2 ] };
3737

@@ -458,7 +458,7 @@ THREE.BufferGeometry.prototype = {
458458

459459
} else {
460460

461-
THREE.warn( 'THREE.BufferGeometry.fromGeometry(): Undefined vertexUv', i );
461+
console.warn( 'THREE.BufferGeometry.fromGeometry(): Undefined vertexUv', i );
462462

463463
}
464464

@@ -485,7 +485,7 @@ THREE.BufferGeometry.prototype = {
485485

486486
} else {
487487

488-
THREE.warn( 'THREE.BufferGeometry.fromGeometry(): Undefined vertexUv2', i );
488+
console.warn( 'THREE.BufferGeometry.fromGeometry(): Undefined vertexUv2', i );
489489

490490
}
491491

@@ -559,7 +559,7 @@ THREE.BufferGeometry.prototype = {
559559

560560
if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {
561561

562-
THREE.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this );
562+
console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this );
563563

564564
}
565565

@@ -613,7 +613,7 @@ THREE.BufferGeometry.prototype = {
613613

614614
if ( isNaN( this.boundingSphere.radius ) ) {
615615

616-
THREE.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this );
616+
console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this );
617617

618618
}
619619

@@ -758,7 +758,7 @@ THREE.BufferGeometry.prototype = {
758758
this.attributes.normal === undefined ||
759759
this.attributes.uv === undefined ) {
760760

761-
THREE.warn( 'THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()' );
761+
console.warn( 'THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()' );
762762
return;
763763

764764
}
@@ -948,9 +948,9 @@ THREE.BufferGeometry.prototype = {
948948
var UintArray = ( ( vertices.length / 3 ) > 65535 && THREE.BufferGeometry.MaxIndex > 65535 ) ? Uint32Array : Uint16Array;
949949

950950
/*
951-
THREE.log("Computing buffers in offsets of "+size+" -> indices:"+indices.length+" vertices:"+vertices.length);
952-
THREE.log("Faces to process: "+(indices.length/3));
953-
THREE.log("Reordering "+verticesCount+" vertices.");
951+
console.log("Computing buffers in offsets of "+size+" -> indices:"+indices.length+" vertices:"+vertices.length);
952+
console.log("Faces to process: "+(indices.length/3));
953+
console.log("Reordering "+verticesCount+" vertices.");
954954
*/
955955

956956
var sortedIndices = new UintArray( indices.length );
@@ -1030,10 +1030,10 @@ THREE.BufferGeometry.prototype = {
10301030

10311031
/*
10321032
var orderTime = Date.now();
1033-
THREE.log("Reorder time: "+(orderTime-s)+"ms");
1034-
THREE.log("Duplicated "+duplicatedVertices+" vertices.");
1035-
THREE.log("Compute Buffers time: "+(Date.now()-s)+"ms");
1036-
THREE.log("Draw offsets: "+offsets.length);
1033+
console.log("Reorder time: "+(orderTime-s)+"ms");
1034+
console.log("Duplicated "+duplicatedVertices+" vertices.");
1035+
console.log("Compute Buffers time: "+(Date.now()-s)+"ms");
1036+
console.log("Draw offsets: "+offsets.length);
10371037
*/
10381038

10391039
return offsets;
@@ -1044,7 +1044,7 @@ THREE.BufferGeometry.prototype = {
10441044

10451045
if ( geometry instanceof THREE.BufferGeometry === false ) {
10461046

1047-
THREE.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry );
1047+
console.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry );
10481048
return;
10491049

10501050
}

src/core/DynamicGeometry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ THREE.DynamicGeometry.prototype = {
4141

4242
computeFaceNormals: function () {
4343

44-
THREE.warn( 'THREE.DynamicGeometry: computeFaceNormals() is not a method of this type of geometry.' );
44+
console.warn( 'THREE.DynamicGeometry: computeFaceNormals() is not a method of this type of geometry.' );
4545
return this;
4646

4747
},
4848

4949
computeVertexNormals: function () {
5050

51-
THREE.warn( 'THREE.DynamicGeometry: computeVertexNormals () is not a method of this type of geometry.' );
51+
console.warn( 'THREE.DynamicGeometry: computeVertexNormals () is not a method of this type of geometry.' );
5252
return this;
5353

5454
},

src/core/Face4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
THREE.Face4 = function ( a, b, c, d, normal, color, materialIndex ) {
66

7-
THREE.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' );
7+
console.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' );
88
return new THREE.Face3( a, b, c, normal, color, materialIndex );
99

1010
};

src/core/Geometry.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ THREE.Geometry.prototype = {
583583

584584
if ( geometry instanceof THREE.Geometry === false ) {
585585

586-
THREE.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry );
586+
console.error( 'THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', geometry );
587587
return;
588588

589589
}
@@ -689,7 +689,7 @@ THREE.Geometry.prototype = {
689689

690690
if ( mesh instanceof THREE.Mesh === false ) {
691691

692-
THREE.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh );
692+
console.error( 'THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', mesh );
693693
return;
694694

695695
}
@@ -730,7 +730,7 @@ THREE.Geometry.prototype = {
730730

731731
} else {
732732

733-
//THREE.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]);
733+
//console.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]);
734734
changes[ i ] = changes[ verticesMap[ key ] ];
735735

736736
}

src/core/Object3D.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,29 +83,29 @@ THREE.Object3D.prototype = {
8383

8484
get eulerOrder () {
8585

86-
THREE.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' );
86+
console.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' );
8787

8888
return this.rotation.order;
8989

9090
},
9191

9292
set eulerOrder ( value ) {
9393

94-
THREE.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' );
94+
console.warn( 'THREE.Object3D: .eulerOrder has been moved to .rotation.order.' );
9595

9696
this.rotation.order = value;
9797

9898
},
9999

100100
get useQuaternion () {
101101

102-
THREE.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
102+
console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
103103

104104
},
105105

106106
set useQuaternion ( value ) {
107107

108-
THREE.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
108+
console.warn( 'THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.' );
109109

110110
},
111111

@@ -223,7 +223,7 @@ THREE.Object3D.prototype = {
223223

224224
translate: function ( distance, axis ) {
225225

226-
THREE.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );
226+
console.warn( 'THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.' );
227227
return this.translateOnAxis( axis, distance );
228228

229229
},
@@ -314,7 +314,7 @@ THREE.Object3D.prototype = {
314314

315315
if ( object === this ) {
316316

317-
THREE.error( "THREE.Object3D.add: object can't be added as a child of itself.", object );
317+
console.error( "THREE.Object3D.add: object can't be added as a child of itself.", object );
318318
return this;
319319

320320
}
@@ -334,7 +334,7 @@ THREE.Object3D.prototype = {
334334

335335
} else {
336336

337-
THREE.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object );
337+
console.error( "THREE.Object3D.add: object not an instance of THREE.Object3D.", object );
338338

339339
}
340340

@@ -370,7 +370,7 @@ THREE.Object3D.prototype = {
370370

371371
getChildByName: function ( name ) {
372372

373-
THREE.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
373+
console.warn( 'THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().' );
374374
return this.getObjectByName( name );
375375

376376
},

src/core/Raycaster.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080
} else {
8181

82-
THREE.error( 'THREE.Raycaster: Unsupported camera type.' );
82+
console.error( 'THREE.Raycaster: Unsupported camera type.' );
8383

8484
}
8585

@@ -103,7 +103,7 @@
103103

104104
if ( objects instanceof Array === false ) {
105105

106-
THREE.warn( 'THREE.Raycaster.intersectObjects: objects is not an Array.' );
106+
console.warn( 'THREE.Raycaster.intersectObjects: objects is not an Array.' );
107107
return intersects;
108108

109109
}

src/extras/FontUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ THREE.FontUtils = {
130130

131131
action = outline[ i ++ ];
132132

133-
//THREE.log( action );
133+
//console.log( action );
134134

135135
switch ( action ) {
136136

@@ -327,7 +327,7 @@ THREE.FontUtils.generateShapes = function ( text, parameters ) {
327327
//throw ( "Warning, unable to triangulate polygon!" );
328328
//return null;
329329
// Sometimes warning is fine, especially polygons are triangulated in reverse.
330-
THREE.warn( 'THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()' );
330+
console.warn( 'THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()' );
331331

332332
if ( indices ) return vertIndices;
333333
return result;

src/extras/GeometryUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ THREE.GeometryUtils = {
66

77
merge: function ( geometry1, geometry2, materialIndexOffset ) {
88

9-
THREE.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );
9+
console.warn( 'THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.' );
1010

1111
var matrix;
1212

@@ -25,7 +25,7 @@ THREE.GeometryUtils = {
2525

2626
center: function ( geometry ) {
2727

28-
THREE.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );
28+
console.warn( 'THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.' );
2929
return geometry.center();
3030

3131
}

0 commit comments

Comments
 (0)