File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -172,26 +172,35 @@ export type IterationOptions = {
172172 static ?: boolean
173173}
174174
175- export const ALL_VNODES : IterationOptions = Object . freeze ( {
176- element : true ,
177- component : true ,
178- comment : true ,
179- text : true ,
180- static : true
181- } )
175+ // esbuild can remove an identity function, so long as it uses a function declaration
176+ function freeze < T > ( obj : T ) : T {
177+ if ( DEV ) {
178+ return Object . freeze ( obj )
179+ }
182180
183- export const COMPONENTS_AND_ELEMENTS : IterationOptions = Object . freeze ( {
181+ return obj
182+ }
183+
184+ export const COMPONENTS_AND_ELEMENTS : IterationOptions = /*#__PURE__*/ freeze ( {
184185 element : true ,
185186 component : true
186187} )
187188
188- export const SKIP_COMMENTS : IterationOptions = Object . freeze ( {
189+ export const SKIP_COMMENTS : IterationOptions = /*#__PURE__*/ freeze ( {
189190 element : true ,
190191 component : true ,
191192 text : true ,
192193 static : true
193194} )
194195
196+ export const ALL_VNODES : IterationOptions = /*#__PURE__*/ freeze ( {
197+ element : true ,
198+ component : true ,
199+ text : true ,
200+ static : true ,
201+ comment : true
202+ } )
203+
195204const promoteToVNode = ( node : VNode | string | number | boolean | null | undefined | void , options : IterationOptions ) : VNode | null => {
196205 const type = getType ( node )
197206
You can’t perform that action at this time.
0 commit comments