From 2aca81b2890c3ecd588860066e4db4c72b80d0f7 Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Fri, 23 Oct 2020 17:08:32 -0700 Subject: [PATCH 1/2] fix: revert feature that broke dynamic to with array values in v17 --- src/Tween.js | 2 +- test/unit/tests.js | 35 +++++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Tween.js b/src/Tween.js index 0c200a79..d1082bba 100644 --- a/src/Tween.js +++ b/src/Tween.js @@ -157,7 +157,7 @@ TWEEN.Tween.prototype = { to: function (properties, duration) { - this._valuesEnd = Object.create(properties); + this._valuesEnd = properties; if (duration !== undefined) { this._duration = duration; diff --git a/test/unit/tests.js b/test/unit/tests.js index 605538a3..afbe043c 100644 --- a/test/unit/tests.js +++ b/test/unit/tests.js @@ -1380,20 +1380,27 @@ }, - 'Arrays in the object passed to to() are not modified by start().': - function(test) { - - var start = {x: 10, y: 20}; - var end = {x: 100, y: 200, values: ['a', 'b']}; - var valuesArray = end.values; - new TWEEN.Tween(start).to(end).start(); - test.equal(valuesArray, end.values); - test.equal(end.values.length, 2); - test.equal(end.values[0], 'a'); - test.equal(end.values[1], 'b'); - test.done(); - - }, + /* + * This test covered a feature that was a breaking change from + * v17.3.0 to v17.3.2 (v17.3.1 was never released). It has been + * reverted and published in v17.6.0 so that v17 can be considered + * fixed. v18 contains the new behavior. v19 will provide a new + * `dynamic` option to `to()` for choosing the desired behavior. + */ + // 'Arrays in the object passed to to() are not modified by start().': + // function(test) { + + // var start = {x: 10, y: 20}; + // var end = {x: 100, y: 200, values: ['a', 'b']}; + // var valuesArray = end.values; + // new TWEEN.Tween(start).to(end).start(); + // test.equal(valuesArray, end.values); + // test.equal(end.values.length, 2); + // test.equal(end.values[0], 'a'); + // test.equal(end.values[1], 'b'); + // test.done(); + + // }, }; From 8349fa76421c8af0c7157ed8db1080e2a6a76b19 Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Fri, 23 Oct 2020 17:10:49 -0700 Subject: [PATCH 2/2] v17.6.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b94cacd8..ae41054d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@tweenjs/tween.js", - "version": "17.3.5", + "version": "17.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index faee2a19..e46559a5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@tweenjs/tween.js", "description": "Super simple, fast and easy to use tweening engine which incorporates optimised Robert Penner's equations.", - "version": "17.3.5", + "version": "17.6.0", "main": "src/Tween.js", "homepage": "https://github.com/tweenjs/tween.js", "repository": {