@@ -15,9 +15,6 @@ import {
1515 type VNodeChild
1616} from 'vue'
1717
18- // @ts -ignore
19- const DEV = process . env . NODE_ENV !== 'production'
20-
2118export const isComment = ( vnode : unknown ) : vnode is ( null | undefined | boolean | ( VNode & { type : typeof CommentVNode } ) ) => {
2219 return getType ( vnode ) === 'comment'
2320}
@@ -157,7 +154,7 @@ const getFragmentChildren = (fragmentVNode: VNode | VNodeArrayChildren): VNodeAr
157154 return children
158155 }
159156
160- if ( DEV ) {
157+ if ( __DEV__ ) {
161158 warn ( 'getFragmentChildren' , `Unknown children for fragment: ${ typeOf ( children ) } ` )
162159 }
163160
@@ -174,7 +171,7 @@ export type IterationOptions = {
174171
175172// esbuild can remove an identity function, so long as it uses a function declaration
176173function freeze < T > ( obj : T ) : T {
177- if ( DEV ) {
174+ if ( __DEV__ ) {
178175 return Object . freeze ( obj )
179176 }
180177
@@ -225,14 +222,14 @@ export const addProps = (
225222 callback : ( vnode : VNode ) => ( Record < string , unknown > | null | void ) ,
226223 options : IterationOptions = COMPONENTS_AND_ELEMENTS
227224) : VNodeArrayChildren => {
228- if ( DEV ) {
225+ if ( __DEV__ ) {
229226 checkArguments ( 'addProps' , [ children , callback , options ] , [ 'array' , 'function' , 'object' ] )
230227 }
231228
232229 return replaceChildrenInternal ( children , ( vnode ) => {
233230 const props = callback ( vnode )
234231
235- if ( DEV ) {
232+ if ( __DEV__ ) {
236233 const typeofProps = typeOf ( props )
237234
238235 if ( ! [ 'object' , 'null' , 'undefined' ] . includes ( typeofProps ) ) {
@@ -251,7 +248,7 @@ export const replaceChildren = (
251248 callback : ( vnode : VNode ) => ( VNode | VNodeArrayChildren | string | number | void ) ,
252249 options : IterationOptions = SKIP_COMMENTS
253250) : VNodeArrayChildren => {
254- if ( DEV ) {
251+ if ( __DEV__ ) {
255252 checkArguments ( 'replaceChildren' , [ children , callback , options ] , [ 'array' , 'function' , 'object' ] )
256253 }
257254
@@ -293,7 +290,7 @@ const replaceChildrenInternal = (
293290 if ( vnode ) {
294291 const newNodes = callback ( vnode ) ?? vnode
295292
296- if ( DEV ) {
293+ if ( __DEV__ ) {
297294 const typeOfNewNodes = typeOf ( newNodes )
298295
299296 if ( ! [ 'array' , 'vnode' , 'string' , 'number' , 'undefined' ] . includes ( typeOfNewNodes ) ) {
@@ -324,7 +321,7 @@ export const betweenChildren = (
324321 callback : ( previousVNode : VNode , nextVNode : VNode ) => ( VNode | VNodeArrayChildren | string | number | void ) ,
325322 options : IterationOptions = SKIP_COMMENTS
326323) : VNodeArrayChildren => {
327- if ( DEV ) {
324+ if ( __DEV__ ) {
328325 checkArguments ( 'betweenChildren' , [ children , callback , options ] , [ 'array' , 'function' , 'object' ] )
329326 }
330327
@@ -336,7 +333,7 @@ export const betweenChildren = (
336333 if ( previousVNode ) {
337334 insertedNodes = callback ( previousVNode , vnode )
338335
339- if ( DEV ) {
336+ if ( __DEV__ ) {
340337 const typeOfInsertedNodes = typeOf ( insertedNodes )
341338
342339 if ( ! [ 'array' , 'vnode' , 'string' , 'number' , 'undefined' ] . includes ( typeOfInsertedNodes ) ) {
@@ -364,7 +361,7 @@ export const someChild = (
364361 callback : ( vnode : VNode ) => unknown ,
365362 options : IterationOptions = ALL_VNODES
366363) : boolean => {
367- if ( DEV ) {
364+ if ( __DEV__ ) {
368365 checkArguments ( 'someChild' , [ children , callback , options ] , [ 'array' , 'function' , 'object' ] )
369366 }
370367
@@ -398,7 +395,7 @@ export const everyChild = (
398395 callback : ( vnode : VNode ) => unknown ,
399396 options : IterationOptions = ALL_VNODES
400397) : boolean => {
401- if ( DEV ) {
398+ if ( __DEV__ ) {
402399 checkArguments ( 'everyChild' , [ children , callback , options ] , [ 'array' , 'function' , 'object' ] )
403400 }
404401
@@ -410,7 +407,7 @@ export const eachChild = (
410407 callback : ( vnode : VNode ) => void ,
411408 options : IterationOptions = ALL_VNODES
412409) : void => {
413- if ( DEV ) {
410+ if ( __DEV__ ) {
414411 checkArguments ( 'eachChild' , [ children , callback , options ] , [ 'array' , 'function' , 'object' ] )
415412 }
416413
@@ -424,7 +421,7 @@ export const findChild = (
424421 callback : ( vnode : VNode ) => unknown ,
425422 options : IterationOptions = ALL_VNODES
426423) : ( VNode | undefined ) => {
427- if ( DEV ) {
424+ if ( __DEV__ ) {
428425 checkArguments ( 'findChild' , [ children , callback , options ] , [ 'array' , 'function' , 'object' ] )
429426 }
430427
@@ -443,7 +440,7 @@ export const findChild = (
443440const COLLAPSIBLE_WHITESPACE_RE = / \S | \u00a0 /
444441
445442export const isEmpty = ( children : VNodeArrayChildren ) : boolean => {
446- if ( DEV ) {
443+ if ( __DEV__ ) {
447444 checkArguments ( 'isEmpty' , [ children ] , [ 'array' ] )
448445 }
449446
@@ -459,15 +456,15 @@ export const isEmpty = (children: VNodeArrayChildren): boolean => {
459456}
460457
461458export const extractSingleChild = ( children : VNodeArrayChildren ) : VNode | undefined => {
462- if ( DEV ) {
459+ if ( __DEV__ ) {
463460 checkArguments ( 'extractSingleChild' , [ children ] , [ 'array' ] )
464461 }
465462
466463 const node = findChild ( children , ( ) => {
467464 return true
468465 } , COMPONENTS_AND_ELEMENTS )
469466
470- if ( DEV ) {
467+ if ( __DEV__ ) {
471468 someChildInternal ( children , ( vnode ) => {
472469 let warning = ''
473470
0 commit comments