diff --git a/js/ui/environment.js b/js/ui/environment.js index e22ec7402..f70394710 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -96,6 +96,15 @@ function init() { Clutter.Actor.prototype.toString = function() { return St.describe_actor(this); }; + // Deprecation warning for former JS classes turned into an actor subclass + Object.defineProperty(Clutter.Actor.prototype, 'actor', { + get() { + let klass = this.constructor.name; + let { stack } = new Error(); + log(`Usage of object.actor is deprecated for ${klass}\n${stack}`); + return this; + } + }); let origToString = Object.prototype.toString; Object.prototype.toString = function() {