File tree Expand file tree Collapse file tree 3 files changed +21
-12
lines changed Expand file tree Collapse file tree 3 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 19
19
}
20
20
}
21
21
} ,
22
- optimizePropertyMaps : function ( prototype , base ) {
22
+ optimizePropertyMaps : function ( prototype ) {
23
23
if ( prototype . observe ) {
24
- // combine name list
25
- prototype . _observeNames = Object . keys ( prototype . observe ) . concat ( base . _observeNames || [ ] ) ;
24
+ // construct name list
25
+ var a = prototype . _observeNames = [ ] ;
26
+ for ( var n in prototype . observe ) {
27
+ a . push ( n ) ;
28
+ }
26
29
// build value list
27
30
prototype . _observeValues = valuesForNames ( prototype . _observeNames , prototype . observe ) ;
28
31
}
29
32
if ( prototype . publish ) {
30
- // combine name list
31
- prototype . _publishNames = Object . keys ( prototype . publish ) . concat ( base . _publishNames || [ ] ) ;
33
+ // construct name list
34
+ var a = prototype . _publishNames = [ ] ;
35
+ for ( var n in prototype . publish ) {
36
+ a . push ( n ) ;
37
+ }
32
38
// build value list
33
39
prototype . _publishValues = valuesForNames ( prototype . _publishNames , prototype . publish ) ;
34
40
}
Original file line number Diff line number Diff line change 53
53
// chain custom api to inherited
54
54
prototype = this . chainObject ( prototype , base ) ;
55
55
// build side-chained lists to optimize iterations
56
- this . optimizePropertyMaps ( prototype , base ) ;
57
- // inherit publishing meta-data
58
- //this.inheritAttributesObjects(prototype);
59
- //this.inheritDelegates(prototype);
60
- // x-platform fixups
56
+ this . optimizePropertyMaps ( prototype ) ;
57
+ // x-platform fixup
61
58
ensurePrototypeTraversal ( prototype ) ;
62
59
return prototype ;
63
60
} ,
Original file line number Diff line number Diff line change 28
28
zot : 3 ,
29
29
bar : 2
30
30
} ,
31
- Foo : '1'
31
+ Foo : '1' ,
32
+ skonkChanged : function ( ) {
33
+ }
32
34
} ) ;
33
35
</ script >
34
36
</ polymer-element >
37
39
38
40
< polymer-element name ="x-three " extends ="x-two " attributes ="quux ">
39
41
< script >
40
- Polymer ( 'x-three' , { } ) ;
42
+ Polymer ( 'x-three' , {
43
+ skonkChanged : function ( ) {
44
+ }
45
+ } ) ;
41
46
</ script >
42
47
</ polymer-element >
43
48
47
52
chai . assert . equal ( x1 . Foo , 'squid' ) ;
48
53
var x3 = document . querySelector ( 'x-three' ) ;
49
54
chai . assert . equal ( x3 . Foo , '3' ) ;
55
+ chai . assert . equal ( x3 . _observeNames . length , 1 , 'x3 should have exactly one observed name' ) ;
50
56
done ( ) ;
51
57
} ) ;
52
58
</ script >
You can’t perform that action at this time.
0 commit comments