File tree 1 file changed +18
-9
lines changed
1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -172,26 +172,35 @@ export type IterationOptions = {
172
172
static ?: boolean
173
173
}
174
174
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
+ }
182
180
183
- export const COMPONENTS_AND_ELEMENTS : IterationOptions = Object . freeze ( {
181
+ return obj
182
+ }
183
+
184
+ export const COMPONENTS_AND_ELEMENTS : IterationOptions = /*#__PURE__*/ freeze ( {
184
185
element : true ,
185
186
component : true
186
187
} )
187
188
188
- export const SKIP_COMMENTS : IterationOptions = Object . freeze ( {
189
+ export const SKIP_COMMENTS : IterationOptions = /*#__PURE__*/ freeze ( {
189
190
element : true ,
190
191
component : true ,
191
192
text : true ,
192
193
static : true
193
194
} )
194
195
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
+
195
204
const promoteToVNode = ( node : VNode | string | number | boolean | null | undefined | void , options : IterationOptions ) : VNode | null => {
196
205
const type = getType ( node )
197
206
You can’t perform that action at this time.
0 commit comments