@@ -99,6 +99,11 @@ export default class ParseObject {
99
99
className : string ;
100
100
101
101
constructor ( className : ?string | { className : string , [ attr : string ] : mixed } , attributes ?: { [ attr : string ] : mixed } , options ?: { ignoreValidation : boolean } ) {
102
+ // Enable legacy initializers
103
+ if ( typeof this . initialize === 'function' ) {
104
+ this . initialize . apply ( this , arguments ) ;
105
+ }
106
+
102
107
var toSet = null ;
103
108
this . _objCount = objectCount ++ ;
104
109
if ( typeof className === 'string' ) {
@@ -121,10 +126,6 @@ export default class ParseObject {
121
126
if ( toSet && ! this . set ( toSet , options ) ) {
122
127
throw new Error ( 'Can\'t create an invalid Parse Object' ) ;
123
128
}
124
- // Enable legacy initializers
125
- if ( typeof this . initialize === 'function' ) {
126
- this . initialize . apply ( this , arguments ) ;
127
- }
128
129
}
129
130
130
131
/** Prototype getters / setters **/
@@ -1371,17 +1372,18 @@ export default class ParseObject {
1371
1372
parentProto = classMap [ adjustedClassName ] . prototype ;
1372
1373
}
1373
1374
var ParseObjectSubclass = function ( attributes , options ) {
1375
+ // Enable legacy initializers
1376
+ if ( typeof this . initialize === 'function' ) {
1377
+ this . initialize . apply ( this , arguments ) ;
1378
+ }
1379
+
1374
1380
this . className = adjustedClassName ;
1375
1381
this . _objCount = objectCount ++ ;
1376
1382
if ( attributes && typeof attributes === 'object' ) {
1377
1383
if ( ! this . set ( attributes || { } , options ) ) {
1378
1384
throw new Error ( 'Can\'t create an invalid Parse Object' ) ;
1379
1385
}
1380
1386
}
1381
- // Enable legacy initializers
1382
- if ( typeof this . initialize === 'function' ) {
1383
- this . initialize . apply ( this , arguments ) ;
1384
- }
1385
1387
} ;
1386
1388
ParseObjectSubclass . className = adjustedClassName ;
1387
1389
ParseObjectSubclass . __super__ = parentProto ;
0 commit comments