@vue/compiler-core 3.3.3 → 3.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -830,7 +830,7 @@ function parseChildren(context, mode, ancestors) {
830
830
  continue;
831
831
  } else if (/[a-z]/i.test(s[2])) {
832
832
  emitError(context, 23);
833
- parseTag(context, TagType.End, parent);
833
+ parseTag(context, 1 /* End */, parent);
834
834
  continue;
835
835
  } else {
836
836
  emitError(
@@ -991,7 +991,7 @@ function parseElement(context, ancestors) {
991
991
  const wasInPre = context.inPre;
992
992
  const wasInVPre = context.inVPre;
993
993
  const parent = last(ancestors);
994
- const element = parseTag(context, TagType.Start, parent);
994
+ const element = parseTag(context, 0 /* Start */, parent);
995
995
  const isPreBoundary = context.inPre && !wasInPre;
996
996
  const isVPreBoundary = context.inVPre && !wasInVPre;
997
997
  if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
@@ -1026,7 +1026,7 @@ function parseElement(context, ancestors) {
1026
1026
  }
1027
1027
  element.children = children;
1028
1028
  if (startsWithEndTagOpen(context.source, element.tag)) {
1029
- parseTag(context, TagType.End, parent);
1029
+ parseTag(context, 1 /* End */, parent);
1030
1030
  } else {
1031
1031
  emitError(context, 24, 0, element.loc.start);
1032
1032
  if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
@@ -1045,11 +1045,6 @@ function parseElement(context, ancestors) {
1045
1045
  }
1046
1046
  return element;
1047
1047
  }
1048
- var TagType = /* @__PURE__ */ ((TagType2) => {
1049
- TagType2[TagType2["Start"] = 0] = "Start";
1050
- TagType2[TagType2["End"] = 1] = "End";
1051
- return TagType2;
1052
- })(TagType || {});
1053
1048
  const isSpecialTemplateDirective = /* @__PURE__ */ shared.makeMap(
1054
1049
  `if,else,else-if,for,slot`
1055
1050
  );
@@ -3172,7 +3167,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3172
3167
  const bailConstant = constantBailRE.test(rawExp);
3173
3168
  if (isSimpleIdentifier(rawExp)) {
3174
3169
  const isScopeVarReference = context.identifiers[rawExp];
3175
- const isAllowedGlobal = shared.isGloballyWhitelisted(rawExp);
3170
+ const isAllowedGlobal = shared.isGloballyAllowed(rawExp);
3176
3171
  const isLiteral = isLiteralWhitelisted(rawExp);
3177
3172
  if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
3178
3173
  if (isConst(bindingMetadata[node.content])) {
@@ -3274,7 +3269,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3274
3269
  return ret;
3275
3270
  }
3276
3271
  function canPrefix(id) {
3277
- if (shared.isGloballyWhitelisted(id.name)) {
3272
+ if (shared.isGloballyAllowed(id.name)) {
3278
3273
  return false;
3279
3274
  }
3280
3275
  if (id.name === "require") {
@@ -826,7 +826,7 @@ function parseChildren(context, mode, ancestors) {
826
826
  continue;
827
827
  } else if (/[a-z]/i.test(s[2])) {
828
828
  emitError(context, 23);
829
- parseTag(context, TagType.End, parent);
829
+ parseTag(context, 1 /* End */, parent);
830
830
  continue;
831
831
  } else {
832
832
  emitError(
@@ -982,7 +982,7 @@ function parseElement(context, ancestors) {
982
982
  const wasInPre = context.inPre;
983
983
  const wasInVPre = context.inVPre;
984
984
  const parent = last(ancestors);
985
- const element = parseTag(context, TagType.Start, parent);
985
+ const element = parseTag(context, 0 /* Start */, parent);
986
986
  const isPreBoundary = context.inPre && !wasInPre;
987
987
  const isVPreBoundary = context.inVPre && !wasInVPre;
988
988
  if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
@@ -1017,7 +1017,7 @@ function parseElement(context, ancestors) {
1017
1017
  }
1018
1018
  element.children = children;
1019
1019
  if (startsWithEndTagOpen(context.source, element.tag)) {
1020
- parseTag(context, TagType.End, parent);
1020
+ parseTag(context, 1 /* End */, parent);
1021
1021
  } else {
1022
1022
  emitError(context, 24, 0, element.loc.start);
1023
1023
  if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
@@ -1036,11 +1036,6 @@ function parseElement(context, ancestors) {
1036
1036
  }
1037
1037
  return element;
1038
1038
  }
1039
- var TagType = /* @__PURE__ */ ((TagType2) => {
1040
- TagType2[TagType2["Start"] = 0] = "Start";
1041
- TagType2[TagType2["End"] = 1] = "End";
1042
- return TagType2;
1043
- })(TagType || {});
1044
1039
  const isSpecialTemplateDirective = /* @__PURE__ */ shared.makeMap(
1045
1040
  `if,else,else-if,for,slot`
1046
1041
  );
@@ -3101,7 +3096,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3101
3096
  const bailConstant = constantBailRE.test(rawExp);
3102
3097
  if (isSimpleIdentifier(rawExp)) {
3103
3098
  const isScopeVarReference = context.identifiers[rawExp];
3104
- const isAllowedGlobal = shared.isGloballyWhitelisted(rawExp);
3099
+ const isAllowedGlobal = shared.isGloballyAllowed(rawExp);
3105
3100
  const isLiteral = isLiteralWhitelisted(rawExp);
3106
3101
  if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
3107
3102
  if (isConst(bindingMetadata[node.content])) {
@@ -3203,7 +3198,7 @@ function processExpression(node, context, asParams = false, asRawStatements = fa
3203
3198
  return ret;
3204
3199
  }
3205
3200
  function canPrefix(id) {
3206
- if (shared.isGloballyWhitelisted(id.name)) {
3201
+ if (shared.isGloballyAllowed(id.name)) {
3207
3202
  return false;
3208
3203
  }
3209
3204
  if (id.name === "require") {
@@ -5,10 +5,10 @@ function defaultOnError(error) {
5
5
  throw error;
6
6
  }
7
7
  function defaultOnWarn(msg) {
8
- process.env.NODE_ENV !== "production" && console.warn(`[Vue warn] ${msg.message}`);
8
+ !!(process.env.NODE_ENV !== "production") && console.warn(`[Vue warn] ${msg.message}`);
9
9
  }
10
10
  function createCompilerError(code, loc, messages, additionalMessage) {
11
- const msg = process.env.NODE_ENV !== "production" || false ? (messages || errorMessages)[code] + (additionalMessage || ``) : code;
11
+ const msg = !!(process.env.NODE_ENV !== "production") || false ? (messages || errorMessages)[code] + (additionalMessage || ``) : code;
12
12
  const error = new SyntaxError(String(msg));
13
13
  error.code = code;
14
14
  error.loc = loc;
@@ -78,47 +78,47 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
78
78
  [53]: ``
79
79
  };
80
80
 
81
- const FRAGMENT = Symbol(process.env.NODE_ENV !== "production" ? `Fragment` : ``);
82
- const TELEPORT = Symbol(process.env.NODE_ENV !== "production" ? `Teleport` : ``);
83
- const SUSPENSE = Symbol(process.env.NODE_ENV !== "production" ? `Suspense` : ``);
84
- const KEEP_ALIVE = Symbol(process.env.NODE_ENV !== "production" ? `KeepAlive` : ``);
85
- const BASE_TRANSITION = Symbol(process.env.NODE_ENV !== "production" ? `BaseTransition` : ``);
86
- const OPEN_BLOCK = Symbol(process.env.NODE_ENV !== "production" ? `openBlock` : ``);
87
- const CREATE_BLOCK = Symbol(process.env.NODE_ENV !== "production" ? `createBlock` : ``);
88
- const CREATE_ELEMENT_BLOCK = Symbol(process.env.NODE_ENV !== "production" ? `createElementBlock` : ``);
89
- const CREATE_VNODE = Symbol(process.env.NODE_ENV !== "production" ? `createVNode` : ``);
90
- const CREATE_ELEMENT_VNODE = Symbol(process.env.NODE_ENV !== "production" ? `createElementVNode` : ``);
91
- const CREATE_COMMENT = Symbol(process.env.NODE_ENV !== "production" ? `createCommentVNode` : ``);
92
- const CREATE_TEXT = Symbol(process.env.NODE_ENV !== "production" ? `createTextVNode` : ``);
93
- const CREATE_STATIC = Symbol(process.env.NODE_ENV !== "production" ? `createStaticVNode` : ``);
94
- const RESOLVE_COMPONENT = Symbol(process.env.NODE_ENV !== "production" ? `resolveComponent` : ``);
81
+ const FRAGMENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Fragment` : ``);
82
+ const TELEPORT = Symbol(!!(process.env.NODE_ENV !== "production") ? `Teleport` : ``);
83
+ const SUSPENSE = Symbol(!!(process.env.NODE_ENV !== "production") ? `Suspense` : ``);
84
+ const KEEP_ALIVE = Symbol(!!(process.env.NODE_ENV !== "production") ? `KeepAlive` : ``);
85
+ const BASE_TRANSITION = Symbol(!!(process.env.NODE_ENV !== "production") ? `BaseTransition` : ``);
86
+ const OPEN_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `openBlock` : ``);
87
+ const CREATE_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `createBlock` : ``);
88
+ const CREATE_ELEMENT_BLOCK = Symbol(!!(process.env.NODE_ENV !== "production") ? `createElementBlock` : ``);
89
+ const CREATE_VNODE = Symbol(!!(process.env.NODE_ENV !== "production") ? `createVNode` : ``);
90
+ const CREATE_ELEMENT_VNODE = Symbol(!!(process.env.NODE_ENV !== "production") ? `createElementVNode` : ``);
91
+ const CREATE_COMMENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `createCommentVNode` : ``);
92
+ const CREATE_TEXT = Symbol(!!(process.env.NODE_ENV !== "production") ? `createTextVNode` : ``);
93
+ const CREATE_STATIC = Symbol(!!(process.env.NODE_ENV !== "production") ? `createStaticVNode` : ``);
94
+ const RESOLVE_COMPONENT = Symbol(!!(process.env.NODE_ENV !== "production") ? `resolveComponent` : ``);
95
95
  const RESOLVE_DYNAMIC_COMPONENT = Symbol(
96
- process.env.NODE_ENV !== "production" ? `resolveDynamicComponent` : ``
96
+ !!(process.env.NODE_ENV !== "production") ? `resolveDynamicComponent` : ``
97
97
  );
98
- const RESOLVE_DIRECTIVE = Symbol(process.env.NODE_ENV !== "production" ? `resolveDirective` : ``);
99
- const RESOLVE_FILTER = Symbol(process.env.NODE_ENV !== "production" ? `resolveFilter` : ``);
100
- const WITH_DIRECTIVES = Symbol(process.env.NODE_ENV !== "production" ? `withDirectives` : ``);
101
- const RENDER_LIST = Symbol(process.env.NODE_ENV !== "production" ? `renderList` : ``);
102
- const RENDER_SLOT = Symbol(process.env.NODE_ENV !== "production" ? `renderSlot` : ``);
103
- const CREATE_SLOTS = Symbol(process.env.NODE_ENV !== "production" ? `createSlots` : ``);
104
- const TO_DISPLAY_STRING = Symbol(process.env.NODE_ENV !== "production" ? `toDisplayString` : ``);
105
- const MERGE_PROPS = Symbol(process.env.NODE_ENV !== "production" ? `mergeProps` : ``);
106
- const NORMALIZE_CLASS = Symbol(process.env.NODE_ENV !== "production" ? `normalizeClass` : ``);
107
- const NORMALIZE_STYLE = Symbol(process.env.NODE_ENV !== "production" ? `normalizeStyle` : ``);
108
- const NORMALIZE_PROPS = Symbol(process.env.NODE_ENV !== "production" ? `normalizeProps` : ``);
109
- const GUARD_REACTIVE_PROPS = Symbol(process.env.NODE_ENV !== "production" ? `guardReactiveProps` : ``);
110
- const TO_HANDLERS = Symbol(process.env.NODE_ENV !== "production" ? `toHandlers` : ``);
111
- const CAMELIZE = Symbol(process.env.NODE_ENV !== "production" ? `camelize` : ``);
112
- const CAPITALIZE = Symbol(process.env.NODE_ENV !== "production" ? `capitalize` : ``);
113
- const TO_HANDLER_KEY = Symbol(process.env.NODE_ENV !== "production" ? `toHandlerKey` : ``);
114
- const SET_BLOCK_TRACKING = Symbol(process.env.NODE_ENV !== "production" ? `setBlockTracking` : ``);
115
- const PUSH_SCOPE_ID = Symbol(process.env.NODE_ENV !== "production" ? `pushScopeId` : ``);
116
- const POP_SCOPE_ID = Symbol(process.env.NODE_ENV !== "production" ? `popScopeId` : ``);
117
- const WITH_CTX = Symbol(process.env.NODE_ENV !== "production" ? `withCtx` : ``);
118
- const UNREF = Symbol(process.env.NODE_ENV !== "production" ? `unref` : ``);
119
- const IS_REF = Symbol(process.env.NODE_ENV !== "production" ? `isRef` : ``);
120
- const WITH_MEMO = Symbol(process.env.NODE_ENV !== "production" ? `withMemo` : ``);
121
- const IS_MEMO_SAME = Symbol(process.env.NODE_ENV !== "production" ? `isMemoSame` : ``);
98
+ const RESOLVE_DIRECTIVE = Symbol(!!(process.env.NODE_ENV !== "production") ? `resolveDirective` : ``);
99
+ const RESOLVE_FILTER = Symbol(!!(process.env.NODE_ENV !== "production") ? `resolveFilter` : ``);
100
+ const WITH_DIRECTIVES = Symbol(!!(process.env.NODE_ENV !== "production") ? `withDirectives` : ``);
101
+ const RENDER_LIST = Symbol(!!(process.env.NODE_ENV !== "production") ? `renderList` : ``);
102
+ const RENDER_SLOT = Symbol(!!(process.env.NODE_ENV !== "production") ? `renderSlot` : ``);
103
+ const CREATE_SLOTS = Symbol(!!(process.env.NODE_ENV !== "production") ? `createSlots` : ``);
104
+ const TO_DISPLAY_STRING = Symbol(!!(process.env.NODE_ENV !== "production") ? `toDisplayString` : ``);
105
+ const MERGE_PROPS = Symbol(!!(process.env.NODE_ENV !== "production") ? `mergeProps` : ``);
106
+ const NORMALIZE_CLASS = Symbol(!!(process.env.NODE_ENV !== "production") ? `normalizeClass` : ``);
107
+ const NORMALIZE_STYLE = Symbol(!!(process.env.NODE_ENV !== "production") ? `normalizeStyle` : ``);
108
+ const NORMALIZE_PROPS = Symbol(!!(process.env.NODE_ENV !== "production") ? `normalizeProps` : ``);
109
+ const GUARD_REACTIVE_PROPS = Symbol(!!(process.env.NODE_ENV !== "production") ? `guardReactiveProps` : ``);
110
+ const TO_HANDLERS = Symbol(!!(process.env.NODE_ENV !== "production") ? `toHandlers` : ``);
111
+ const CAMELIZE = Symbol(!!(process.env.NODE_ENV !== "production") ? `camelize` : ``);
112
+ const CAPITALIZE = Symbol(!!(process.env.NODE_ENV !== "production") ? `capitalize` : ``);
113
+ const TO_HANDLER_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? `toHandlerKey` : ``);
114
+ const SET_BLOCK_TRACKING = Symbol(!!(process.env.NODE_ENV !== "production") ? `setBlockTracking` : ``);
115
+ const PUSH_SCOPE_ID = Symbol(!!(process.env.NODE_ENV !== "production") ? `pushScopeId` : ``);
116
+ const POP_SCOPE_ID = Symbol(!!(process.env.NODE_ENV !== "production") ? `popScopeId` : ``);
117
+ const WITH_CTX = Symbol(!!(process.env.NODE_ENV !== "production") ? `withCtx` : ``);
118
+ const UNREF = Symbol(!!(process.env.NODE_ENV !== "production") ? `unref` : ``);
119
+ const IS_REF = Symbol(!!(process.env.NODE_ENV !== "production") ? `isRef` : ``);
120
+ const WITH_MEMO = Symbol(!!(process.env.NODE_ENV !== "production") ? `withMemo` : ``);
121
+ const IS_MEMO_SAME = Symbol(!!(process.env.NODE_ENV !== "production") ? `isMemoSame` : ``);
122
122
  const helperNameMap = {
123
123
  [FRAGMENT]: `Fragment`,
124
124
  [TELEPORT]: `Teleport`,
@@ -645,7 +645,7 @@ function hasScopeRef(node, ids) {
645
645
  case 3:
646
646
  return false;
647
647
  default:
648
- if (process.env.NODE_ENV !== "production") ;
648
+ if (!!(process.env.NODE_ENV !== "production")) ;
649
649
  return false;
650
650
  }
651
651
  }
@@ -709,7 +709,7 @@ function isCompatEnabled(key, context) {
709
709
  }
710
710
  function checkCompatEnabled(key, context, loc, ...args) {
711
711
  const enabled = isCompatEnabled(key, context);
712
- if (process.env.NODE_ENV !== "production" && enabled) {
712
+ if (!!(process.env.NODE_ENV !== "production") && enabled) {
713
713
  warnDeprecation(key, context, loc, ...args);
714
714
  }
715
715
  return enabled;
@@ -747,7 +747,7 @@ const defaultParserOptions = {
747
747
  decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]),
748
748
  onError: defaultOnError,
749
749
  onWarn: defaultOnWarn,
750
- comments: process.env.NODE_ENV !== "production"
750
+ comments: !!(process.env.NODE_ENV !== "production")
751
751
  };
752
752
  function baseParse(content, options = {}) {
753
753
  const context = createParserContext(content, options);
@@ -813,7 +813,7 @@ function parseChildren(context, mode, ancestors) {
813
813
  continue;
814
814
  } else if (/[a-z]/i.test(s[2])) {
815
815
  emitError(context, 23);
816
- parseTag(context, TagType.End, parent);
816
+ parseTag(context, 1 /* End */, parent);
817
817
  continue;
818
818
  } else {
819
819
  emitError(
@@ -831,7 +831,7 @@ function parseChildren(context, mode, ancestors) {
831
831
  ) && node && node.tag === "template" && !node.props.some(
832
832
  (p) => p.type === 7 && isSpecialTemplateDirective(p.name)
833
833
  )) {
834
- process.env.NODE_ENV !== "production" && warnDeprecation(
834
+ !!(process.env.NODE_ENV !== "production") && warnDeprecation(
835
835
  "COMPILER_NATIVE_TEMPLATE",
836
836
  context,
837
837
  node.loc
@@ -974,7 +974,7 @@ function parseElement(context, ancestors) {
974
974
  const wasInPre = context.inPre;
975
975
  const wasInVPre = context.inVPre;
976
976
  const parent = last(ancestors);
977
- const element = parseTag(context, TagType.Start, parent);
977
+ const element = parseTag(context, 0 /* Start */, parent);
978
978
  const isPreBoundary = context.inPre && !wasInPre;
979
979
  const isVPreBoundary = context.inVPre && !wasInVPre;
980
980
  if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {
@@ -1009,7 +1009,7 @@ function parseElement(context, ancestors) {
1009
1009
  }
1010
1010
  element.children = children;
1011
1011
  if (startsWithEndTagOpen(context.source, element.tag)) {
1012
- parseTag(context, TagType.End, parent);
1012
+ parseTag(context, 1 /* End */, parent);
1013
1013
  } else {
1014
1014
  emitError(context, 24, 0, element.loc.start);
1015
1015
  if (context.source.length === 0 && element.tag.toLowerCase() === "script") {
@@ -1028,11 +1028,6 @@ function parseElement(context, ancestors) {
1028
1028
  }
1029
1029
  return element;
1030
1030
  }
1031
- var TagType = /* @__PURE__ */ ((TagType2) => {
1032
- TagType2[TagType2["Start"] = 0] = "Start";
1033
- TagType2[TagType2["End"] = 1] = "End";
1034
- return TagType2;
1035
- })(TagType || {});
1036
1031
  const isSpecialTemplateDirective = /* @__PURE__ */ makeMap(
1037
1032
  `if,else,else-if,for,slot`
1038
1033
  );
@@ -1068,7 +1063,7 @@ function parseTag(context, type, parent) {
1068
1063
  if (type === 1 /* End */) {
1069
1064
  return;
1070
1065
  }
1071
- if (process.env.NODE_ENV !== "production" && isCompatEnabled(
1066
+ if (!!(process.env.NODE_ENV !== "production") && isCompatEnabled(
1072
1067
  "COMPILER_V_IF_V_FOR_PRECEDENCE",
1073
1068
  context
1074
1069
  )) {
@@ -1286,7 +1281,7 @@ function parseAttribute(context, nameSet) {
1286
1281
  dirName = "model";
1287
1282
  modifiers.splice(modifiers.indexOf("sync"), 1);
1288
1283
  }
1289
- if (process.env.NODE_ENV !== "production" && modifiers.includes("prop")) {
1284
+ if (!!(process.env.NODE_ENV !== "production") && modifiers.includes("prop")) {
1290
1285
  checkCompatEnabled(
1291
1286
  "COMPILER_V_BIND_PROP",
1292
1287
  context,
@@ -1529,7 +1524,7 @@ function walk(node, context, doNotHoistNode = false) {
1529
1524
  const constantType = doNotHoistNode ? 0 : getConstantType(child, context);
1530
1525
  if (constantType > 0) {
1531
1526
  if (constantType >= 2) {
1532
- child.codegenNode.patchFlag = -1 + (process.env.NODE_ENV !== "production" ? ` /* HOISTED */` : ``);
1527
+ child.codegenNode.patchFlag = -1 + (!!(process.env.NODE_ENV !== "production") ? ` /* HOISTED */` : ``);
1533
1528
  child.codegenNode = context.hoist(child.codegenNode);
1534
1529
  hoistedCount++;
1535
1530
  continue;
@@ -1683,7 +1678,7 @@ function getConstantType(node, context) {
1683
1678
  }
1684
1679
  return returnType;
1685
1680
  default:
1686
- if (process.env.NODE_ENV !== "production") ;
1681
+ if (!!(process.env.NODE_ENV !== "production")) ;
1687
1682
  return 0;
1688
1683
  }
1689
1684
  }
@@ -1836,7 +1831,7 @@ function createTransformContext(root, {
1836
1831
  return `_${helperNameMap[context.helper(name)]}`;
1837
1832
  },
1838
1833
  replaceNode(node) {
1839
- if (process.env.NODE_ENV !== "production") {
1834
+ if (!!(process.env.NODE_ENV !== "production")) {
1840
1835
  if (!context.currentNode) {
1841
1836
  throw new Error(`Node being replaced is already removed.`);
1842
1837
  }
@@ -1847,12 +1842,12 @@ function createTransformContext(root, {
1847
1842
  context.parent.children[context.childIndex] = context.currentNode = node;
1848
1843
  },
1849
1844
  removeNode(node) {
1850
- if (process.env.NODE_ENV !== "production" && !context.parent) {
1845
+ if (!!(process.env.NODE_ENV !== "production") && !context.parent) {
1851
1846
  throw new Error(`Cannot remove root node.`);
1852
1847
  }
1853
1848
  const list = context.parent.children;
1854
1849
  const removalIndex = node ? list.indexOf(node) : context.currentNode ? context.childIndex : -1;
1855
- if (process.env.NODE_ENV !== "production" && removalIndex < 0) {
1850
+ if (!!(process.env.NODE_ENV !== "production") && removalIndex < 0) {
1856
1851
  throw new Error(`node being removed is not a child of current parent`);
1857
1852
  }
1858
1853
  if (!node || node === context.currentNode) {
@@ -1931,7 +1926,7 @@ function createRootCodegen(root, context) {
1931
1926
  } else if (children.length > 1) {
1932
1927
  let patchFlag = 64;
1933
1928
  let patchFlagText = PatchFlagNames[64];
1934
- if (process.env.NODE_ENV !== "production" && children.filter((c) => c.type !== 3).length === 1) {
1929
+ if (!!(process.env.NODE_ENV !== "production") && children.filter((c) => c.type !== 3).length === 1) {
1935
1930
  patchFlag |= 2048;
1936
1931
  patchFlagText += `, ${PatchFlagNames[2048]}`;
1937
1932
  }
@@ -1940,7 +1935,7 @@ function createRootCodegen(root, context) {
1940
1935
  helper(FRAGMENT),
1941
1936
  void 0,
1942
1937
  root.children,
1943
- patchFlag + (process.env.NODE_ENV !== "production" ? ` /* ${patchFlagText} */` : ``),
1938
+ patchFlag + (!!(process.env.NODE_ENV !== "production") ? ` /* ${patchFlagText} */` : ``),
1944
1939
  void 0,
1945
1940
  void 0,
1946
1941
  true,
@@ -2262,7 +2257,7 @@ function isText(n) {
2262
2257
  return isString(n) || n.type === 4 || n.type === 2 || n.type === 5 || n.type === 8;
2263
2258
  }
2264
2259
  function genNodeListAsArray(nodes, context) {
2265
- const multilines = nodes.length > 3 || process.env.NODE_ENV !== "production" && nodes.some((n) => isArray(n) || !isText(n));
2260
+ const multilines = nodes.length > 3 || !!(process.env.NODE_ENV !== "production") && nodes.some((n) => isArray(n) || !isText(n));
2266
2261
  context.push(`[`);
2267
2262
  multilines && context.indent();
2268
2263
  genNodeList(nodes, context, multilines);
@@ -2303,7 +2298,7 @@ function genNode(node, context) {
2303
2298
  case 1:
2304
2299
  case 9:
2305
2300
  case 11:
2306
- process.env.NODE_ENV !== "production" && assert(
2301
+ !!(process.env.NODE_ENV !== "production") && assert(
2307
2302
  node.codegenNode != null,
2308
2303
  `Codegen node is missing for element/if/for node. Apply appropriate transforms first.`
2309
2304
  );
@@ -2364,7 +2359,7 @@ function genNode(node, context) {
2364
2359
  case 10:
2365
2360
  break;
2366
2361
  default:
2367
- if (process.env.NODE_ENV !== "production") {
2362
+ if (!!(process.env.NODE_ENV !== "production")) {
2368
2363
  assert(false, `unhandled codegen node type: ${node.type}`);
2369
2364
  const exhaustiveCheck = node;
2370
2365
  return exhaustiveCheck;
@@ -2479,7 +2474,7 @@ function genObjectExpression(node, context) {
2479
2474
  push(`{}`, node);
2480
2475
  return;
2481
2476
  }
2482
- const multilines = properties.length > 1 || process.env.NODE_ENV !== "production" && properties.some((p) => p.value.type !== 4);
2477
+ const multilines = properties.length > 1 || !!(process.env.NODE_ENV !== "production") && properties.some((p) => p.value.type !== 4);
2483
2478
  push(multilines ? `{` : `{ `);
2484
2479
  multilines && indent();
2485
2480
  for (let i = 0; i < properties.length; i++) {
@@ -2755,7 +2750,7 @@ const transformExpression = (node, context) => {
2755
2750
  };
2756
2751
  function processExpression(node, context, asParams = false, asRawStatements = false, localVars = Object.create(context.identifiers)) {
2757
2752
  {
2758
- if (process.env.NODE_ENV !== "production") {
2753
+ if (!!(process.env.NODE_ENV !== "production")) {
2759
2754
  validateBrowserExpression(node, context, asParams, asRawStatements);
2760
2755
  }
2761
2756
  return node;
@@ -2811,7 +2806,7 @@ function processIf(node, dir, context, processCodegen) {
2811
2806
  );
2812
2807
  dir.exp = createSimpleExpression(`true`, false, loc);
2813
2808
  }
2814
- if (process.env.NODE_ENV !== "production" && true && dir.exp) {
2809
+ if (!!(process.env.NODE_ENV !== "production") && true && dir.exp) {
2815
2810
  validateBrowserExpression(dir.exp, context);
2816
2811
  }
2817
2812
  if (dir.name === "if") {
@@ -2832,7 +2827,8 @@ function processIf(node, dir, context, processCodegen) {
2832
2827
  while (i-- >= -1) {
2833
2828
  const sibling = siblings[i];
2834
2829
  if (sibling && sibling.type === 3) {
2835
- context.removeNode(sibling)(process.env.NODE_ENV !== "production") && comments.unshift(sibling);
2830
+ context.removeNode(sibling);
2831
+ !!(process.env.NODE_ENV !== "production") && comments.unshift(sibling);
2836
2832
  continue;
2837
2833
  }
2838
2834
  if (sibling && sibling.type === 2 && !sibling.content.trim().length) {
@@ -2847,11 +2843,11 @@ function processIf(node, dir, context, processCodegen) {
2847
2843
  }
2848
2844
  context.removeNode();
2849
2845
  const branch = createIfBranch(node, dir);
2850
- if (process.env.NODE_ENV !== "production" && comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
2846
+ if (!!(process.env.NODE_ENV !== "production") && comments.length && // #3619 ignore comments if the v-if is direct child of <transition>
2851
2847
  !(context.parent && context.parent.type === 1 && isBuiltInType(context.parent.tag, "transition"))) {
2852
2848
  branch.children = [...comments, ...branch.children];
2853
2849
  }
2854
- if (process.env.NODE_ENV !== "production" || false) {
2850
+ if (!!(process.env.NODE_ENV !== "production") || false) {
2855
2851
  const key = branch.userKey;
2856
2852
  if (key) {
2857
2853
  sibling.branches.forEach(({ userKey }) => {
@@ -2900,7 +2896,7 @@ function createCodegenNodeForBranch(branch, keyIndex, context) {
2900
2896
  // make sure to pass in asBlock: true so that the comment node call
2901
2897
  // closes the current block.
2902
2898
  createCallExpression(context.helper(CREATE_COMMENT), [
2903
- process.env.NODE_ENV !== "production" ? '"v-if"' : '""',
2899
+ !!(process.env.NODE_ENV !== "production") ? '"v-if"' : '""',
2904
2900
  "true"
2905
2901
  ])
2906
2902
  );
@@ -2930,7 +2926,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
2930
2926
  } else {
2931
2927
  let patchFlag = 64;
2932
2928
  let patchFlagText = PatchFlagNames[64];
2933
- if (process.env.NODE_ENV !== "production" && !branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
2929
+ if (!!(process.env.NODE_ENV !== "production") && !branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
2934
2930
  patchFlag |= 2048;
2935
2931
  patchFlagText += `, ${PatchFlagNames[2048]}`;
2936
2932
  }
@@ -2939,7 +2935,7 @@ function createChildrenCodegenNode(branch, keyIndex, context) {
2939
2935
  helper(FRAGMENT),
2940
2936
  createObjectExpression([keyProperty]),
2941
2937
  children,
2942
- patchFlag + (process.env.NODE_ENV !== "production" ? ` /* ${patchFlagText} */` : ``),
2938
+ patchFlag + (!!(process.env.NODE_ENV !== "production") ? ` /* ${patchFlagText} */` : ``),
2943
2939
  void 0,
2944
2940
  void 0,
2945
2941
  true,
@@ -3012,7 +3008,7 @@ const transformFor = createStructuralDirectiveTransform(
3012
3008
  helper(FRAGMENT),
3013
3009
  void 0,
3014
3010
  renderExp,
3015
- fragmentFlag + (process.env.NODE_ENV !== "production" ? ` /* ${PatchFlagNames[fragmentFlag]} */` : ``),
3011
+ fragmentFlag + (!!(process.env.NODE_ENV !== "production") ? ` /* ${PatchFlagNames[fragmentFlag]} */` : ``),
3016
3012
  void 0,
3017
3013
  void 0,
3018
3014
  true,
@@ -3023,7 +3019,7 @@ const transformFor = createStructuralDirectiveTransform(
3023
3019
  return () => {
3024
3020
  let childBlock;
3025
3021
  const { children } = forNode;
3026
- if ((process.env.NODE_ENV !== "production" || false) && isTemplate) {
3022
+ if ((!!(process.env.NODE_ENV !== "production") || false) && isTemplate) {
3027
3023
  node.children.some((c) => {
3028
3024
  if (c.type === 1) {
3029
3025
  const key = findProp(c, "key");
@@ -3052,7 +3048,7 @@ const transformFor = createStructuralDirectiveTransform(
3052
3048
  helper(FRAGMENT),
3053
3049
  keyProperty ? createObjectExpression([keyProperty]) : void 0,
3054
3050
  node.children,
3055
- 64 + (process.env.NODE_ENV !== "production" ? ` /* ${PatchFlagNames[64]} */` : ``),
3051
+ 64 + (!!(process.env.NODE_ENV !== "production") ? ` /* ${PatchFlagNames[64]} */` : ``),
3056
3052
  void 0,
3057
3053
  void 0,
3058
3054
  true,
@@ -3183,7 +3179,7 @@ function parseForExpression(input, context) {
3183
3179
  key: void 0,
3184
3180
  index: void 0
3185
3181
  };
3186
- if (process.env.NODE_ENV !== "production" && true) {
3182
+ if (!!(process.env.NODE_ENV !== "production") && true) {
3187
3183
  validateBrowserExpression(result.source, context);
3188
3184
  }
3189
3185
  let valueContent = LHS.trim().replace(stripParensRE, "").trim();
@@ -3196,7 +3192,7 @@ function parseForExpression(input, context) {
3196
3192
  if (keyContent) {
3197
3193
  keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
3198
3194
  result.key = createAliasExpression(loc, keyContent, keyOffset);
3199
- if (process.env.NODE_ENV !== "production" && true) {
3195
+ if (!!(process.env.NODE_ENV !== "production") && true) {
3200
3196
  validateBrowserExpression(
3201
3197
  result.key,
3202
3198
  context,
@@ -3215,7 +3211,7 @@ function parseForExpression(input, context) {
3215
3211
  result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
3216
3212
  )
3217
3213
  );
3218
- if (process.env.NODE_ENV !== "production" && true) {
3214
+ if (!!(process.env.NODE_ENV !== "production") && true) {
3219
3215
  validateBrowserExpression(
3220
3216
  result.index,
3221
3217
  context,
@@ -3227,7 +3223,7 @@ function parseForExpression(input, context) {
3227
3223
  }
3228
3224
  if (valueContent) {
3229
3225
  result.value = createAliasExpression(loc, valueContent, trimmedOffset);
3230
- if (process.env.NODE_ENV !== "production" && true) {
3226
+ if (!!(process.env.NODE_ENV !== "production") && true) {
3231
3227
  validateBrowserExpression(
3232
3228
  result.value,
3233
3229
  context,
@@ -3472,7 +3468,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
3472
3468
  // 2 = compiled but dynamic = can skip normalization, but must run diff
3473
3469
  // 1 = compiled and static = can skip normalization AND diff as optimized
3474
3470
  createSimpleExpression(
3475
- slotFlag + (process.env.NODE_ENV !== "production" ? ` /* ${slotFlagsText[slotFlag]} */` : ``),
3471
+ slotFlag + (!!(process.env.NODE_ENV !== "production") ? ` /* ${slotFlagsText[slotFlag]} */` : ``),
3476
3472
  false
3477
3473
  )
3478
3474
  )
@@ -3579,7 +3575,7 @@ const transformElement = (node, context) => {
3579
3575
  if (vnodeTag === KEEP_ALIVE) {
3580
3576
  shouldUseBlock = true;
3581
3577
  patchFlag |= 1024;
3582
- if (process.env.NODE_ENV !== "production" && node.children.length > 1) {
3578
+ if (!!(process.env.NODE_ENV !== "production") && node.children.length > 1) {
3583
3579
  context.onError(
3584
3580
  createCompilerError(46, {
3585
3581
  start: node.children[0].loc.start,
@@ -3615,7 +3611,7 @@ const transformElement = (node, context) => {
3615
3611
  }
3616
3612
  }
3617
3613
  if (patchFlag !== 0) {
3618
- if (process.env.NODE_ENV !== "production") {
3614
+ if (!!(process.env.NODE_ENV !== "production")) {
3619
3615
  if (patchFlag < 0) {
3620
3616
  vnodePatchFlag = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */`;
3621
3617
  } else {
@@ -3665,7 +3661,7 @@ function resolveComponentType(node, context, ssr = false) {
3665
3661
  }
3666
3662
  const isDir = !isExplicitDynamic && findDir(node, "is");
3667
3663
  if (isDir && isDir.exp) {
3668
- if (process.env.NODE_ENV !== "production") {
3664
+ if (!!(process.env.NODE_ENV !== "production")) {
3669
3665
  context.onWarn(
3670
3666
  createCompilerError(52, isDir.loc)
3671
3667
  );
@@ -3824,7 +3820,7 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
3824
3820
  if (isVBind) {
3825
3821
  pushMergeArg();
3826
3822
  {
3827
- if (process.env.NODE_ENV !== "production") {
3823
+ if (!!(process.env.NODE_ENV !== "production")) {
3828
3824
  const hasOverridableKeys = mergeArgs.some((arg2) => {
3829
3825
  if (arg2.type === 15) {
3830
3826
  return arg2.properties.some(({ key }) => {
@@ -4175,7 +4171,7 @@ const transformOn = (dir, node, context, augmentor) => {
4175
4171
  if (arg.type === 4) {
4176
4172
  if (arg.isStatic) {
4177
4173
  let rawName = arg.content;
4178
- if (process.env.NODE_ENV !== "production" && rawName.startsWith("vnode")) {
4174
+ if (!!(process.env.NODE_ENV !== "production") && rawName.startsWith("vnode")) {
4179
4175
  context.onWarn(
4180
4176
  createCompilerError(51, arg.loc)
4181
4177
  );
@@ -4214,7 +4210,7 @@ const transformOn = (dir, node, context, augmentor) => {
4214
4210
  const isMemberExp = isMemberExpression(exp.content);
4215
4211
  const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
4216
4212
  const hasMultipleStatements = exp.content.includes(`;`);
4217
- if (process.env.NODE_ENV !== "production" && true) {
4213
+ if (!!(process.env.NODE_ENV !== "production") && true) {
4218
4214
  validateBrowserExpression(
4219
4215
  exp,
4220
4216
  context,
@@ -4355,7 +4351,7 @@ const transformText = (node, context) => {
4355
4351
  }
4356
4352
  if (!context.ssr && getConstantType(child, context) === 0) {
4357
4353
  callArgs.push(
4358
- 1 + (process.env.NODE_ENV !== "production" ? ` /* ${PatchFlagNames[1]} */` : ``)
4354
+ 1 + (!!(process.env.NODE_ENV !== "production") ? ` /* ${PatchFlagNames[1]} */` : ``)
4359
4355
  );
4360
4356
  }
4361
4357
  children[i] = {
@@ -4578,7 +4574,7 @@ function parseFilter(node, context) {
4578
4574
  lastFilterIndex = i + 1;
4579
4575
  }
4580
4576
  if (filters.length) {
4581
- process.env.NODE_ENV !== "production" && warnDeprecation(
4577
+ !!(process.env.NODE_ENV !== "production") && warnDeprecation(
4582
4578
  "COMPILER_FILTER",
4583
4579
  context,
4584
4580
  node.loc
@@ -4636,7 +4632,7 @@ function getBaseTransformPreset(prefixIdentifiers) {
4636
4632
  transformMemo,
4637
4633
  transformFor,
4638
4634
  ...[transformFilter] ,
4639
- ...process.env.NODE_ENV !== "production" ? [transformExpression] : [],
4635
+ ...!!(process.env.NODE_ENV !== "production") ? [transformExpression] : [],
4640
4636
  transformSlotOutlet,
4641
4637
  transformElement,
4642
4638
  trackSlotScopes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.3.3",
3
+ "version": "3.3.5",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -32,12 +32,12 @@
32
32
  },
33
33
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
34
34
  "dependencies": {
35
- "@babel/parser": "^7.21.3",
36
- "@vue/shared": "3.3.3",
35
+ "@babel/parser": "^7.23.0",
36
+ "@vue/shared": "3.3.5",
37
37
  "estree-walker": "^2.0.2",
38
38
  "source-map-js": "^1.0.2"
39
39
  },
40
40
  "devDependencies": {
41
- "@babel/types": "^7.21.3"
41
+ "@babel/types": "^7.23.0"
42
42
  }
43
43
  }