File tree Expand file tree Collapse file tree 5 files changed +55
-6
lines changed Expand file tree Collapse file tree 5 files changed +55
-6
lines changed Original file line number Diff line number Diff line change @@ -70,22 +70,22 @@ class Documentation {
70
70
71
71
if ( this . _props . size > 0 ) {
72
72
obj . props = { } ;
73
- for ( var [ name , descriptor ] of this . _props ) {
74
- obj . props [ name ] = descriptor ;
73
+ for ( var [ propName , propDescriptor ] of this . _props ) {
74
+ obj . props [ propName ] = propDescriptor ;
75
75
}
76
76
}
77
77
78
78
if ( this . _context . size > 0 ) {
79
79
obj . context = { } ;
80
- for ( var [ name , descriptor ] of this . _context ) {
81
- obj . context [ name ] = descriptor ;
80
+ for ( var [ contextName , contextDescriptor ] of this . _context ) {
81
+ obj . context [ contextName ] = contextDescriptor ;
82
82
}
83
83
}
84
84
85
85
if ( this . _childContext . size > 0 ) {
86
86
obj . childContext = { } ;
87
- for ( var [ name , descriptor ] of this . _childContext ) {
88
- obj . childContext [ name ] = descriptor ;
87
+ for ( var [ childContextName , childContextDescriptor ] of this . _childContext ) {
88
+ obj . childContext [ childContextName ] = childContextDescriptor ;
89
89
}
90
90
}
91
91
Original file line number Diff line number Diff line change @@ -102,6 +102,22 @@ Object {
102
102
103
103
exports [` main fixtures processes component "component_5.js" without errors 1` ] = `
104
104
Object {
105
+ " childContext" : Object {
106
+ " color" : Object {
107
+ " required" : false ,
108
+ " type" : Object {
109
+ " name" : " string" ,
110
+ },
111
+ },
112
+ },
113
+ " context" : Object {
114
+ " config" : Object {
115
+ " required" : false ,
116
+ " type" : Object {
117
+ " name" : " object" ,
118
+ },
119
+ },
120
+ },
105
121
" description" : " " ,
106
122
" displayName" : " Button" ,
107
123
" methods" : Array [],
@@ -137,6 +153,22 @@ Object {
137
153
138
154
exports [` main fixtures processes component "component_6.js" without errors 1` ] = `
139
155
Object {
156
+ " childContext" : Object {
157
+ " color" : Object {
158
+ " required" : false ,
159
+ " type" : Object {
160
+ " name" : " string" ,
161
+ },
162
+ },
163
+ },
164
+ " context" : Object {
165
+ " config" : Object {
166
+ " required" : false ,
167
+ " type" : Object {
168
+ " name" : " object" ,
169
+ },
170
+ },
171
+ },
140
172
" description" : " " ,
141
173
" displayName" : " Button" ,
142
174
" methods" : Array [],
Original file line number Diff line number Diff line change @@ -15,4 +15,12 @@ Button.propTypes = {
15
15
style : React . PropTypes . object ,
16
16
} ;
17
17
18
+ Button . childContextTypes = {
19
+ color : React . PropTypes . string ,
20
+ } ;
21
+
22
+ Button . contextTypes = {
23
+ config : React . PropTypes . object ,
24
+ } ;
25
+
18
26
export default Button ;
Original file line number Diff line number Diff line change @@ -16,4 +16,11 @@ Button.propTypes = {
16
16
style : PropTypes . object ,
17
17
} ;
18
18
19
+ Button . childContextTypes = {
20
+ color : PropTypes . string ,
21
+ } ;
22
+
23
+ Button . contextTypes = {
24
+ config : PropTypes . object ,
25
+ } ;
19
26
export default Button ;
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ import * as utils from './utils';
18
18
var defaultResolver = resolver . findExportedComponentDefinition ;
19
19
var defaultHandlers = [
20
20
handlers . propTypeHandler ,
21
+ handlers . contextTypeHandler ,
22
+ handlers . childContextTypeHandler ,
21
23
handlers . propTypeCompositionHandler ,
22
24
handlers . propDocBlockHandler ,
23
25
handlers . flowTypeHandler ,
You can’t perform that action at this time.
0 commit comments