浏览代码

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 年之前
父节点
当前提交
9f14c6ffe7
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 4 0
      src/animation/AnimationAction.js
  2. 1 1
      test/unit/src/animation/AnimationAction.tests.js

+ 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 () {