Skip to content

Commit 8b1baf9

Browse files
committed
Add grace period for getAnimationPlayers and make shared.deprecated log properly.
1 parent af4319a commit 8b1baf9

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/deprecation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
};
3535

3636
shared.deprecated = function(feature, date, advice, plural) {
37+
var auxVerb = plural ? 'are' : 'is';
3738
if (shared.isDeprecated(feature, date, advice, plural)) {
3839
throw new Error(feature + ' ' + auxVerb + ' no longer supported. ' + advice);
3940
}

src/keyframe-effect-constructor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@
103103
return animation.effect !== null && animation.effect.target == this;
104104
}.bind(this));
105105
};
106+
window.Element.prototype.getAnimationPlayers = function() {
107+
shared.deprecated('Element.getAnimationPlayers', '2015-03-23', 'Use Element.getAnimations instead.');
108+
return this.getAnimations();
109+
};
106110

107111
// Alias KeyframeEffect to Animation, to support old constructor (Animation) for a deprecation
108112
// period. Should be removed after 23 June 2015.

src/timeline.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
this._discardAnimations();
2929
return this._animations.slice();
3030
},
31+
getAnimationPlayers: function() {
32+
shared.deprecated('AnimationTimeline.getAnimationPlayers', '2015-03-23', 'Use AnimationTimeline.getAnimations instead.');
33+
return this.getAnimations();
34+
},
3135
_discardAnimations: function() {
3236
this._animations = this._animations.filter(function(animation) {
3337
return animation.playState != 'finished' && animation.playState != 'idle';

0 commit comments

Comments
 (0)
close