File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,15 @@ common("any", {
5151 type : "bytes" ,
5252 id : 2
5353 }
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+ })*/
5563 }
5664} ) ;
5765
Original file line number Diff line number Diff line change @@ -446,14 +446,18 @@ Type.prototype.setup = function setup() {
446446 types : types ,
447447 util : util
448448 } ) ;
449- this . fromObject = this . from = converter . fromObject ( this ) . eof ( fullName + "$fromObject" , {
449+ this . fromObject = converter . fromObject ( this ) . eof ( fullName + "$fromObject" , {
450450 types : types ,
451451 util : util
452452 } ) ;
453+ if ( this . options && this . options . __formObject )
454+ this . fromObject = this . options . __formObject . bind ( { fromObject : this . fromObject } ) ;
453455 this . toObject = converter . toObject ( this ) . eof ( fullName + "$toObject" , {
454456 types : types ,
455457 util : util
456458 } ) ;
459+ if ( this . options && this . options . __toObject )
460+ this . toObject = this . options . __toObject . bind ( { toObject : this . toObject } ) ;
457461 return this ;
458462} ;
459463
You can’t perform that action at this time.
0 commit comments