@@ -105,6 +105,45 @@ exports.createComponent_ = function(
105105 return self ;
106106 }
107107
108+ function shouldComponentUpdate ( nextProps , nextState ) {
109+ var shouldUpdate = this . $$spec . shouldUpdate ;
110+ return shouldUpdate === defaultShouldUpdate
111+ ? true
112+ : shouldUpdate ( {
113+ props : this . props . $$props ,
114+ state : this . state === null ? null : this . state . $$state
115+ } ) ( nextProps . $$props ) ( nextState === null ? null : nextState . $$state ) ;
116+ }
117+
118+ function componentDidMount ( ) {
119+ var didMount = this . $$spec . didMount ;
120+ if ( didMount !== defaultDidMount ) {
121+ this . $$spec . didMount ( contextToSelf ( this ) ) ( ) ;
122+ }
123+ }
124+
125+ function componentDidUpdate ( ) {
126+ var didUpdate = this . $$spec . didUpdate ;
127+ if ( didUpdate !== defaultDidUpdate ) {
128+ didUpdate ( contextToSelf ( this ) ) ( ) ;
129+ }
130+ }
131+
132+ function componentWillUnmount ( ) {
133+ this . $$mounted = false ;
134+ var willUnmount = this . $$spec . willUnmount ;
135+ if ( willUnmount !== defaultWillUnmount ) {
136+ willUnmount ( {
137+ props : this . props . $$props ,
138+ state : this . state === null ? null : this . state . $$state
139+ } ) ( ) ;
140+ }
141+ }
142+
143+ function render ( ) {
144+ return this . $$spec . render ( contextToSelf ( this ) ) ;
145+ }
146+
108147 return function ( displayName ) {
109148 var Component = function constructor ( props ) {
110149 this . $$mounted = true ;
@@ -119,48 +158,13 @@ exports.createComponent_ = function(
119158 return this ;
120159 } ;
121160
122- Component . prototype = Object . create ( React . Component . prototype ) ;
123-
124161 Component . displayName = displayName ;
125-
126- Component . prototype . shouldComponentUpdate = function ( nextProps , nextState ) {
127- var shouldUpdate = this . $$spec . shouldUpdate ;
128- return shouldUpdate === defaultShouldUpdate
129- ? true
130- : shouldUpdate ( {
131- props : this . props . $$props ,
132- state : this . state === null ? null : this . state . $$state
133- } ) ( nextProps . $$props ) ( nextState === null ? null : nextState . $$state ) ;
134- } ;
135-
136- Component . prototype . componentDidMount = function ( ) {
137- var didMount = this . $$spec . didMount ;
138- if ( didMount !== defaultDidMount ) {
139- this . $$spec . didMount ( contextToSelf ( this ) ) ( ) ;
140- }
141- } ;
142-
143- Component . prototype . componentDidUpdate = function ( ) {
144- var didUpdate = this . $$spec . didUpdate ;
145- if ( didUpdate !== defaultDidUpdate ) {
146- didUpdate ( contextToSelf ( this ) ) ( ) ;
147- }
148- } ;
149-
150- Component . prototype . componentWillUnmount = function ( ) {
151- this . $$mounted = false ;
152- var willUnmount = this . $$spec . willUnmount ;
153- if ( willUnmount !== defaultWillUnmount ) {
154- willUnmount ( {
155- props : this . props . $$props ,
156- state : this . state === null ? null : this . state . $$state
157- } ) ( ) ;
158- }
159- } ;
160-
161- Component . prototype . render = function ( ) {
162- return this . $$spec . render ( contextToSelf ( this ) ) ;
163- } ;
162+ Component . prototype = Object . create ( React . Component . prototype ) ;
163+ Component . prototype . shouldComponentUpdate = shouldComponentUpdate ;
164+ Component . prototype . componentDidMount = componentDidMount ;
165+ Component . prototype . componentDidUpdate = componentDidUpdate ;
166+ Component . prototype . componentWillUnmount = componentWillUnmount ;
167+ Component . prototype . render = render ;
164168
165169 return {
166170 $$type : Component ,
0 commit comments