Browse Source

Fixed:
- test did not provide arguments necessary for new AnimationClip.
- AnimationAction constructor did not throw exceptions needed by the test.

Ondřej Španěl 7 years ago
parent
commit
9f14c6ffe7

+ 4 - 0
src/animation/AnimationAction.js

@@ -13,6 +13,10 @@ import { WrapAroundEnding, ZeroCurvatureEnding, ZeroSlopeEnding, LoopPingPong, L
 
 function AnimationAction( mixer, clip, localRoot ) {
 
+	if ( ! mixer ) throw new Error( "Mixer can't be null or undefined !" );
+
+	if ( ! clip ) throw new Error( "Clip can't be null or undefined !" );
+
 	this._mixer = mixer;
 	this._clip = clip;
 	this._localRoot = localRoot || null;

+ 1 - 1
test/unit/src/animation/AnimationAction.tests.js

@@ -15,7 +15,7 @@ export default QUnit.module( 'Animation', () => {
 		QUnit.test( "Instancing", ( assert ) => {
 
 			var mixer = new AnimationMixer();
-			var clip = new AnimationClip();
+			var clip = new AnimationClip( "nonname", - 1, [] );
 
 			assert.throws(
 				function () {