@@ -96,7 +96,7 @@ export interface SetupContext {
96
96
97
97
export type RenderFunction = {
98
98
( ) : VNodeChild
99
- isRuntimeCompiled ?: boolean
99
+ _rc ?: boolean // isRuntimeCompiled
100
100
}
101
101
102
102
export interface ComponentInternalInstance {
@@ -437,29 +437,24 @@ function finishComponentSetup(
437
437
instance . render = Component . render as RenderFunction
438
438
}
439
439
} else if ( ! instance . render ) {
440
- if ( __RUNTIME_COMPILE__ && Component . template && ! Component . render ) {
441
- // __RUNTIME_COMPILE__ ensures `compile` is provided
442
- Component . render = compile ! ( Component . template , {
440
+ if ( compile && Component . template && ! Component . render ) {
441
+ Component . render = compile ( Component . template , {
443
442
isCustomElement : instance . appContext . config . isCustomElement || NO
444
443
} )
445
444
// mark the function as runtime compiled
446
- ; ( Component . render as RenderFunction ) . isRuntimeCompiled = true
445
+ ; ( Component . render as RenderFunction ) . _rc = true
447
446
}
448
447
449
448
if ( __DEV__ && ! Component . render ) {
450
449
/* istanbul ignore if */
451
- if ( ! __RUNTIME_COMPILE__ && Component . template ) {
450
+ if ( ! compile && Component . template ) {
452
451
warn (
453
452
`Component provides template but the build of Vue you are running ` +
454
453
`does not support runtime template compilation. Either use the ` +
455
454
`full build or pre-compile the template using Vue CLI.`
456
455
)
457
456
} else {
458
- warn (
459
- `Component is missing${
460
- __RUNTIME_COMPILE__ ? ` template or` : ``
461
- } render function.`
462
- )
457
+ warn ( `Component is missing template or render function.` )
463
458
}
464
459
}
465
460
@@ -468,7 +463,7 @@ function finishComponentSetup(
468
463
// for runtime-compiled render functions using `with` blocks, the render
469
464
// proxy used needs a different `has` handler which is more performant and
470
465
// also only allows a whitelist of globals to fallthrough.
471
- if ( __RUNTIME_COMPILE__ && instance . render . isRuntimeCompiled ) {
466
+ if ( instance . render . _rc ) {
472
467
instance . withProxy = new Proxy (
473
468
instance ,
474
469
runtimeCompiledRenderProxyHandlers
0 commit comments