@@ -119,26 +119,26 @@ module.exports = window;
119119 * @return {VDom } Returns the VDom element
120120 */
121121 expandStateful = ( vnode , hooks ) =>
122- ( vnode . $ || hooks ) . bind // Avoid "undefined" case when resolving bind
122+ ( vnode . $ || hooks ) . bind // Avoid "undefined" case when resolving bind
123123 ? expandStateful (
124124 vnode . $ (
125- vnode . a , // 1. The component properties
126- hooks . s , // 2. The stateful component state
125+ vnode . a , // 1. The component properties
126+ hooks . s , // 2. The stateful component state
127127
128- ( newState ) => // 3. The setState function
128+ ( newState ) => // 3. The setState function
129129
130- Object . assign ( // First we update the state record, that also
131- hooks . s , // updates the contents of the DOM element, since
132- newState // the reference is perserved.
130+ Object . assign ( // First we update the state record, that also
131+ hooks . s , // updates the contents of the DOM element, since
132+ newState // the reference is perserved.
133133 ) &&
134- render ( vnodes , dom ) , // And then we call-out to the re-render function
135- // that holds the correct variable scopes.
134+ render ( vnodes , dom ) , // And then we call-out to the re-render function
135+ // that holds the correct variable scopes.
136136
137- hooks // 4. The lifecycle method hooks
137+ hooks // 4. The lifecycle method hooks
138138 ) ,
139139 hooks
140140 )
141- : vnode , // If this is not a functional component, return
141+ : vnode , // If this is not a functional component, return
142142
143143 /**
144144 * Perform propery-level reconciliation on the given DOM node
@@ -150,40 +150,39 @@ module.exports = window;
150150 */
151151 updateDom = ( node , vnode , hooks ) => (
152152 vnode . $
153- ? Object . keys ( vnode . a ) . map ( // - Element nodes have properties
154- ( key ) => // 1. The property name
155- key == "style" ? // The "style" property is an object and must be
156- // applied recursively.
153+ ? Object . keys ( vnode . a ) . map ( // - Element nodes have properties
154+ ( key ) => // 1. The property name
155+ key == "style" ? // The "style" property is an object and must be
156+ // applied recursively.
157157 Object . assign (
158- node [ key ] , // "[key]" is shorter than ".style"
158+ node [ key ] , // "[key]" is shorter than ".style"
159159 vnode . a [ key ]
160160 )
161161
162- : ( node [ key ] == vnode . a [ key ] // All properties are applied directly to DOM, as
163- ? node : ( node [ key ] = vnode . a [ key ] ) ) // long as they are different than ther value in the
164- // instance. This includes `onXXX` event handlers.
162+ : ( node [ key ] == vnode . a [ key ] // All properties are applied directly to DOM, as
163+ ? node : ( node [ key ] = vnode . a [ key ] ) ) // long as they are different than ther value in the
164+ // instance. This includes `onXXX` event handlers.
165165
166166 ) &&
167- ( vnode . a . k = hooks . k ) && // Explicitly update the key property of the virtual node
168- // in order to enable dynamic re-ordering when re-ordering
169- // the VDom instance
167+ ( vnode . a . k = hooks . k ) && // Explicitly update the key property of the virtual node
168+ // in order to enable dynamic re-ordering when re-ordering
169+ // the VDom instance
170170
171- ( hooks . r || // If the user has marked this element as "raw", do not
172- // continue to it"s children. Failing to do so, will damage
173- // the element contents
171+ ( hooks . r || // If the user has marked this element as "raw", do not
172+ // continue to it"s children. Failing to do so, will damage
173+ // the element contents
174174
175- render ( // Only if we have an element (and not text node)
176- vnode . a . c , // we recursively continue rendering into it"s
177- node // child nodes.
175+ render ( // Only if we have an element (and not text node)
176+ vnode . a . c , // we recursively continue rendering into it"s
177+ node // child nodes.
178178 ) )
179- : ( node . data == vnode ) // - String nodes update only the text content is changed
179+ : ( node . data == vnode ) // - String nodes update only the text content is changed
180180 ? node : ( node . data = vnode ) ,
181181 Object . assign ( node , hooks ) ,
182182 _new_cache [ hooks . k ] = node
183183 ) ,
184184
185- _index = { } ,
186- _reorder_flag
185+ _index = { }
187186
188187 ) =>
189188
@@ -225,13 +224,11 @@ module.exports = window;
225224 updateDom (
226225 // (We are recycling the no-longer used `vnode` property
227226 // as a compression optimization)
228- ( vnode = // Keep track of the node we just added because we will need
227+ ( vnode = // Keep track of the node we just added because we will need
229228 // it for the next iteration and for the last part of the
230229 // current function call.
231230
232- ( _reorder_flag |= // If the node is correctly ordered, then the key of the
233- ( ( dom . childNodes [ idx ] || _xvnode ) . k != _key ) // previous node should be the expected.
234- )
231+ ( ( ( dom . childNodes [ idx ] || _xvnode ) . k ) != _key ) // previous node should be the expected.
235232 ? dom . insertBefore ( // a. If the node should be re-ordered, place it right after
236233 _prevnode || // the last known item.
237234 ( _xvnode . $
@@ -273,7 +270,7 @@ module.exports = window;
273270 createElement ,
274271 {
275272 get : ( targetFn , tagName ) =>
276- createElement [ tagName ] || // Make sure we don"t override any native
273+ createElement [ tagName ] || // Make sure we don"t override any native
277274 // property or method from the base function
278275
279276 wrapClassProxy ( // Otherwise, for every tag we extract a
0 commit comments