This repository was archived by the owner on Mar 13, 2018. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010 var properties = {
1111 inferObservers : function ( prototype ) {
12+ // called before prototype.observe is chained to inherited object
1213 var observe = prototype . observe , property ;
1314 for ( var n in prototype ) {
1415 if ( n . slice ( - 7 ) === 'Changed' ) {
1920 observe [ property ] = observe [ property ] || n ;
2021 }
2122 }
23+ this . explodeObservers ( prototype ) ;
24+ } ,
25+ explodeObservers : function ( prototype ) {
26+ // called before prototype.observe is chained to inherited object
27+ var o = prototype . observe ;
28+ if ( o ) {
29+ var exploded = { } ;
30+ for ( var n in o ) {
31+ var names = n . split ( ' ' ) ;
32+ for ( var i = 0 , ni ; ni = names [ i ] ; i ++ ) {
33+ exploded [ ni ] = o [ n ] ;
34+ }
35+ }
36+ prototype . observe = exploded ;
37+ }
2238 } ,
2339 optimizePropertyMaps : function ( prototype ) {
2440 if ( prototype . observe ) {
2541 // construct name list
2642 var a = prototype . _observeNames = [ ] ;
2743 for ( var n in prototype . observe ) {
28- a . push ( n ) ;
44+ var names = n . split ( ' ' ) ;
45+ for ( var i = 0 , ni ; ni = names [ i ] ; i ++ ) {
46+ a . push ( ni ) ;
47+ }
48+ //a.push(n);
2949 }
3050 }
3151 if ( prototype . publish ) {
Original file line number Diff line number Diff line change 201201 }
202202 } ;
203203
204+ // implementation of 'chainObject' depends on support for __proto__
204205 if ( Object . __proto__ ) {
205206 prototype . chainObject = function ( object , inherited ) {
206207 if ( object && inherited && object !== inherited ) {
You can’t perform that action at this time.
0 commit comments