@@ -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 **/
@@ -1366,17 +1367,18 @@ export default class ParseObject {
1366
1367
parentProto = classMap [ adjustedClassName ] . prototype ;
1367
1368
}
1368
1369
var ParseObjectSubclass = function ( attributes , options ) {
1370
+ // Enable legacy initializers
1371
+ if ( typeof this . initialize === 'function' ) {
1372
+ this . initialize . apply ( this , arguments ) ;
1373
+ }
1374
+
1369
1375
this . className = adjustedClassName ;
1370
1376
this . _objCount = objectCount ++ ;
1371
1377
if ( attributes && typeof attributes === 'object' ) {
1372
1378
if ( ! this . set ( attributes || { } , options ) ) {
1373
1379
throw new Error ( 'Can\'t create an invalid Parse Object' ) ;
1374
1380
}
1375
1381
}
1376
- // Enable legacy initializers
1377
- if ( typeof this . initialize === 'function' ) {
1378
- this . initialize . apply ( this , arguments ) ;
1379
- }
1380
1382
} ;
1381
1383
ParseObjectSubclass . className = adjustedClassName ;
1382
1384
ParseObjectSubclass . __super__ = parentProto ;
0 commit comments