Skip to content

Commit 315d0fc

Browse files
committed
Object3D: Renamed removeAll to clear.
1 parent 2b082dc commit 315d0fc

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

docs/api/en/core/Object3D.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ <h3>[method:this remove]( [param:Object3D object], ... )</h3>
314314
Removes *object* as child of this object. An arbitrary number of objects may be removed.
315315
</p>
316316

317-
<h3>[method:this removeAll]()</h3>
317+
<h3>[method:this clear]()</h3>
318318
<p>
319319
Removes all child objects.
320320
</p>

src/core/Object3D.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ export class Object3D extends EventDispatcher {
319319
/**
320320
* Removes all child objects.
321321
*/
322-
removeAll(): this;
322+
clear(): this;
323323

324324
/**
325325
* Adds object as a child of this, while maintaining the object's world transform.

src/core/Object3D.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
370370

371371
},
372372

373-
removeAll: function () {
373+
clear: function () {
374374

375375
for ( let i = 0; i < this.children.length; i ++ ) {
376376

test/unit/src/core/Object3D.tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export default QUnit.module( 'Core', () => {
296296

297297
} );
298298

299-
QUnit.test( "add/remove/removeAll", ( assert ) => {
299+
QUnit.test( "add/remove/clear", ( assert ) => {
300300

301301
var a = new Object3D();
302302
var child1 = new Object3D();
@@ -330,7 +330,7 @@ export default QUnit.module( 'Core', () => {
330330

331331
a.add( child1 );
332332
assert.strictEqual( a.children.length, 2, "The first child was added to the parent" );
333-
a.removeAll();
333+
a.clear();
334334
assert.strictEqual( a.children.length, 0, "All childrens were removed" );
335335
assert.strictEqual( child1.parent, null, "First child has no parent" );
336336
assert.strictEqual( child2.parent, null, "Second child has no parent" );

0 commit comments

Comments
 (0)