File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,15 @@ common("any", {
51
51
type : "bytes" ,
52
52
id : 2
53
53
}
54
- }
54
+ } /*,
55
+ options: Object.create({
56
+ __fromObject: function(object) {
57
+ return this.fromObject(object);
58
+ },
59
+ __toObject: function(options) {
60
+ return this.toObject(options);
61
+ }
62
+ })*/
55
63
}
56
64
} ) ;
57
65
Original file line number Diff line number Diff line change @@ -446,14 +446,18 @@ Type.prototype.setup = function setup() {
446
446
types : types ,
447
447
util : util
448
448
} ) ;
449
- this . fromObject = this . from = converter . fromObject ( this ) . eof ( fullName + "$fromObject" , {
449
+ this . fromObject = converter . fromObject ( this ) . eof ( fullName + "$fromObject" , {
450
450
types : types ,
451
451
util : util
452
452
} ) ;
453
+ if ( this . options && this . options . __formObject )
454
+ this . fromObject = this . options . __formObject . bind ( { fromObject : this . fromObject } ) ;
453
455
this . toObject = converter . toObject ( this ) . eof ( fullName + "$toObject" , {
454
456
types : types ,
455
457
util : util
456
458
} ) ;
459
+ if ( this . options && this . options . __toObject )
460
+ this . toObject = this . options . __toObject . bind ( { toObject : this . toObject } ) ;
457
461
return this ;
458
462
} ;
459
463
You can’t perform that action at this time.
0 commit comments