@@ -56,7 +56,7 @@ this.createjs = this.createjs || {};
5656 * @type {String }
5757 * @static
5858 **/
59- s . buildDate = /*=date*/ "Wed, 21 Jun 2017 16:42:40 GMT" ; // injected by build process
59+ s . buildDate = /*=date*/ "Thu, 14 Sep 2017 22:19:45 GMT" ; // injected by build process
6060
6161} ) ( ) ;
6262
@@ -156,6 +156,48 @@ createjs.promote = function(subclass, prefix) {
156156 return subclass ;
157157} ;
158158
159+ //##############################################################################
160+ // deprecate.js
161+ //##############################################################################
162+
163+ this . createjs = this . createjs || { } ;
164+
165+ /**
166+ * @class Utility Methods
167+ */
168+
169+ /**
170+ * Wraps deprecated methods so they still be used, but throw warnings to developers.
171+ *
172+ * obj.deprecatedMethod = createjs.deprecate("Old Method Name", obj._fallbackMethod);
173+ *
174+ * The recommended approach for deprecated properties is:
175+ *
176+ * try {
177+ * Obj ect.defineProperties(object, {
178+ * readyOnlyProp: { get: createjs.deprecate("readOnlyProp", function() { return this.alternateProp; }) },
179+ * readWriteProp: {
180+ * get: createjs.deprecate("readOnlyProp", function() { return this.alternateProp; }),
181+ * set: createjs.deprecate("readOnlyProp", function(val) { this.alternateProp = val; })
182+ * });
183+ * } catch (e) {}
184+ *
185+ * @method deprecate
186+ * @param {Function} [fallbackMethod=null] A method to call when the deprecated method is used. See the example for how
187+ * @param {String} [name=null] The name of the method or property to display in the console warning.
188+ * to deprecate properties.
189+ * @return {Function } If a fallbackMethod is supplied, returns a closure that will call the fallback method after
190+ * logging the warning in the console.
191+ */
192+ createjs . deprecate = function ( fallbackMethod , name ) {
193+ "use strict" ;
194+ return function ( ) {
195+ var msg = "Deprecated property or method '" + name + "'. See docs for info." ;
196+ console && ( console . warn ? console . warn ( msg ) : console . log ( msg ) ) ;
197+ return fallbackMethod && fallbackMethod . apply ( this , arguments ) ;
198+ }
199+ } ;
200+
159201//##############################################################################
160202// proxy.js
161203//##############################################################################
@@ -2745,7 +2787,7 @@ this.createjs = this.createjs || {};
27452787 * if it is an unusual extension.
27462788 * @method getTypeByExtension
27472789 * @param {String } extension The file extension to use to determine the load type.
2748- * @return {String } The determined load type (for example, <code>AbstractLoader. IMAGE</code> ). Will return `null` if
2790+ * @return {String } The determined load type (for example, `createjs.Types. IMAGE` ). Will return `null` if
27492791 * the type can not be determined by the extension.
27502792 * @static
27512793 */
@@ -2955,6 +2997,30 @@ this.createjs = this.createjs || {};
29552997 var p = createjs . extend ( AbstractLoader , createjs . EventDispatcher ) ;
29562998 var s = AbstractLoader ;
29572999
3000+ // Remove these @deprecated properties after 1.0
3001+ try {
3002+ Object . defineProperties ( s , {
3003+ POST : { get : createjs . deprecate ( function ( ) { return createjs . Methods . POST ; } , "AbstractLoader.POST" ) } ,
3004+ GET : { get : createjs . deprecate ( function ( ) { return createjs . Methods . GET ; } , "AbstractLoader.GET" ) } ,
3005+
3006+ BINARY : { get : createjs . deprecate ( function ( ) { return createjs . Types . BINARY ; } , "AbstractLoader.BINARY" ) } ,
3007+ CSS : { get : createjs . deprecate ( function ( ) { return createjs . Types . CSS ; } , "AbstractLoader.CSS" ) } ,
3008+ FONT : { get : createjs . deprecate ( function ( ) { return createjs . Types . FONT ; } , "AbstractLoader.FONT" ) } ,
3009+ FONTCSS : { get : createjs . deprecate ( function ( ) { return createjs . Types . FONTCSS ; } , "AbstractLoader.FONTCSS" ) } ,
3010+ IMAGE : { get : createjs . deprecate ( function ( ) { return createjs . Types . IMAGE ; } , "AbstractLoader.IMAGE" ) } ,
3011+ JAVASCRIPT : { get : createjs . deprecate ( function ( ) { return createjs . Types . JAVASCRIPT ; } , "AbstractLoader.JAVASCRIPT" ) } ,
3012+ JSON : { get : createjs . deprecate ( function ( ) { return createjs . Types . JSON ; } , "AbstractLoader.JSON" ) } ,
3013+ JSONP : { get : createjs . deprecate ( function ( ) { return createjs . Types . JSONP ; } , "AbstractLoader.JSONP" ) } ,
3014+ MANIFEST : { get : createjs . deprecate ( function ( ) { return createjs . Types . MANIFEST ; } , "AbstractLoader.MANIFEST" ) } ,
3015+ SOUND : { get : createjs . deprecate ( function ( ) { return createjs . Types . SOUND ; } , "AbstractLoader.SOUND" ) } ,
3016+ VIDEO : { get : createjs . deprecate ( function ( ) { return createjs . Types . VIDEO ; } , "AbstractLoader.VIDEO" ) } ,
3017+ SPRITESHEET : { get : createjs . deprecate ( function ( ) { return createjs . Types . SPRITESHEET ; } , "AbstractLoader.SPRITESHEET" ) } ,
3018+ SVG : { get : createjs . deprecate ( function ( ) { return createjs . Types . SVG ; } , "AbstractLoader.SVG" ) } ,
3019+ TEXT : { get : createjs . deprecate ( function ( ) { return createjs . Types . TEXT ; } , "AbstractLoader.TEXT" ) } ,
3020+ XML : { get : createjs . deprecate ( function ( ) { return createjs . Types . XML ; } , "AbstractLoader.XML" ) }
3021+ } ) ;
3022+ } catch ( e ) { }
3023+
29583024// Events
29593025 /**
29603026 * The {{#crossLink "ProgressEvent"}}{{/crossLink}} that is fired when the overall progress changes. Prior to
@@ -4613,6 +4679,30 @@ this.createjs = this.createjs || {};
46134679 var p = createjs . extend ( LoadQueue , createjs . AbstractLoader ) ;
46144680 var s = LoadQueue ;
46154681
4682+ // Remove these @deprecated properties after 1.0
4683+ try {
4684+ Object . defineProperties ( s , {
4685+ POST : { get : createjs . deprecate ( function ( ) { return createjs . Methods . POST ; } , "AbstractLoader.POST" ) } ,
4686+ GET : { get : createjs . deprecate ( function ( ) { return createjs . Methods . GET ; } , "AbstractLoader.GET" ) } ,
4687+
4688+ BINARY : { get : createjs . deprecate ( function ( ) { return createjs . Types . BINARY ; } , "AbstractLoader.BINARY" ) } ,
4689+ CSS : { get : createjs . deprecate ( function ( ) { return createjs . Types . CSS ; } , "AbstractLoader.CSS" ) } ,
4690+ FONT : { get : createjs . deprecate ( function ( ) { return createjs . Types . FONT ; } , "AbstractLoader.FONT" ) } ,
4691+ FONTCSS : { get : createjs . deprecate ( function ( ) { return createjs . Types . FONTCSS ; } , "AbstractLoader.FONTCSS" ) } ,
4692+ IMAGE : { get : createjs . deprecate ( function ( ) { return createjs . Types . IMAGE ; } , "AbstractLoader.IMAGE" ) } ,
4693+ JAVASCRIPT : { get : createjs . deprecate ( function ( ) { return createjs . Types . JAVASCRIPT ; } , "AbstractLoader.JAVASCRIPT" ) } ,
4694+ JSON : { get : createjs . deprecate ( function ( ) { return createjs . Types . JSON ; } , "AbstractLoader.JSON" ) } ,
4695+ JSONP : { get : createjs . deprecate ( function ( ) { return createjs . Types . JSONP ; } , "AbstractLoader.JSONP" ) } ,
4696+ MANIFEST : { get : createjs . deprecate ( function ( ) { return createjs . Types . MANIFEST ; } , "AbstractLoader.MANIFEST" ) } ,
4697+ SOUND : { get : createjs . deprecate ( function ( ) { return createjs . Types . SOUND ; } , "AbstractLoader.SOUND" ) } ,
4698+ VIDEO : { get : createjs . deprecate ( function ( ) { return createjs . Types . VIDEO ; } , "AbstractLoader.VIDEO" ) } ,
4699+ SPRITESHEET : { get : createjs . deprecate ( function ( ) { return createjs . Types . SPRITESHEET ; } , "AbstractLoader.SPRITESHEET" ) } ,
4700+ SVG : { get : createjs . deprecate ( function ( ) { return createjs . Types . SVG ; } , "AbstractLoader.SVG" ) } ,
4701+ TEXT : { get : createjs . deprecate ( function ( ) { return createjs . Types . TEXT ; } , "AbstractLoader.TEXT" ) } ,
4702+ XML : { get : createjs . deprecate ( function ( ) { return createjs . Types . XML ; } , "AbstractLoader.XML" ) }
4703+ } ) ;
4704+ } catch ( e ) { }
4705+
46164706 /**
46174707 * An internal initialization method, which is used for initial set up, but also to reset the LoadQueue.
46184708 * @method init
0 commit comments