WXL
3 天以前 9bce51f651aad297ef9eb6df832bfdaf1de05d84
node_modules/@vue/compiler-core/dist/compiler-core.cjs.js
@@ -1,5 +1,5 @@
/**
* @vue/compiler-core v3.5.25
* @vue/compiler-core v3.5.32
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
@@ -8,86 +8,86 @@
Object.defineProperty(exports, '__esModule', { value: true });
var shared = require('@vue/shared');
var decode_js = require('entities/lib/decode.js');
var decode = require('entities/decode');
var parser = require('@babel/parser');
var estreeWalker = require('estree-walker');
var sourceMapJs = require('source-map-js');
const FRAGMENT = Symbol(`Fragment` );
const TELEPORT = Symbol(`Teleport` );
const SUSPENSE = Symbol(`Suspense` );
const KEEP_ALIVE = Symbol(`KeepAlive` );
const BASE_TRANSITION = Symbol(
const FRAGMENT = /* @__PURE__ */ Symbol(`Fragment` );
const TELEPORT = /* @__PURE__ */ Symbol(`Teleport` );
const SUSPENSE = /* @__PURE__ */ Symbol(`Suspense` );
const KEEP_ALIVE = /* @__PURE__ */ Symbol(`KeepAlive` );
const BASE_TRANSITION = /* @__PURE__ */ Symbol(
  `BaseTransition` 
);
const OPEN_BLOCK = Symbol(`openBlock` );
const CREATE_BLOCK = Symbol(`createBlock` );
const CREATE_ELEMENT_BLOCK = Symbol(
const OPEN_BLOCK = /* @__PURE__ */ Symbol(`openBlock` );
const CREATE_BLOCK = /* @__PURE__ */ Symbol(`createBlock` );
const CREATE_ELEMENT_BLOCK = /* @__PURE__ */ Symbol(
  `createElementBlock` 
);
const CREATE_VNODE = Symbol(`createVNode` );
const CREATE_ELEMENT_VNODE = Symbol(
const CREATE_VNODE = /* @__PURE__ */ Symbol(`createVNode` );
const CREATE_ELEMENT_VNODE = /* @__PURE__ */ Symbol(
  `createElementVNode` 
);
const CREATE_COMMENT = Symbol(
const CREATE_COMMENT = /* @__PURE__ */ Symbol(
  `createCommentVNode` 
);
const CREATE_TEXT = Symbol(
const CREATE_TEXT = /* @__PURE__ */ Symbol(
  `createTextVNode` 
);
const CREATE_STATIC = Symbol(
const CREATE_STATIC = /* @__PURE__ */ Symbol(
  `createStaticVNode` 
);
const RESOLVE_COMPONENT = Symbol(
const RESOLVE_COMPONENT = /* @__PURE__ */ Symbol(
  `resolveComponent` 
);
const RESOLVE_DYNAMIC_COMPONENT = Symbol(
const RESOLVE_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol(
  `resolveDynamicComponent` 
);
const RESOLVE_DIRECTIVE = Symbol(
const RESOLVE_DIRECTIVE = /* @__PURE__ */ Symbol(
  `resolveDirective` 
);
const RESOLVE_FILTER = Symbol(
const RESOLVE_FILTER = /* @__PURE__ */ Symbol(
  `resolveFilter` 
);
const WITH_DIRECTIVES = Symbol(
const WITH_DIRECTIVES = /* @__PURE__ */ Symbol(
  `withDirectives` 
);
const RENDER_LIST = Symbol(`renderList` );
const RENDER_SLOT = Symbol(`renderSlot` );
const CREATE_SLOTS = Symbol(`createSlots` );
const TO_DISPLAY_STRING = Symbol(
const RENDER_LIST = /* @__PURE__ */ Symbol(`renderList` );
const RENDER_SLOT = /* @__PURE__ */ Symbol(`renderSlot` );
const CREATE_SLOTS = /* @__PURE__ */ Symbol(`createSlots` );
const TO_DISPLAY_STRING = /* @__PURE__ */ Symbol(
  `toDisplayString` 
);
const MERGE_PROPS = Symbol(`mergeProps` );
const NORMALIZE_CLASS = Symbol(
const MERGE_PROPS = /* @__PURE__ */ Symbol(`mergeProps` );
const NORMALIZE_CLASS = /* @__PURE__ */ Symbol(
  `normalizeClass` 
);
const NORMALIZE_STYLE = Symbol(
const NORMALIZE_STYLE = /* @__PURE__ */ Symbol(
  `normalizeStyle` 
);
const NORMALIZE_PROPS = Symbol(
const NORMALIZE_PROPS = /* @__PURE__ */ Symbol(
  `normalizeProps` 
);
const GUARD_REACTIVE_PROPS = Symbol(
const GUARD_REACTIVE_PROPS = /* @__PURE__ */ Symbol(
  `guardReactiveProps` 
);
const TO_HANDLERS = Symbol(`toHandlers` );
const CAMELIZE = Symbol(`camelize` );
const CAPITALIZE = Symbol(`capitalize` );
const TO_HANDLER_KEY = Symbol(
const TO_HANDLERS = /* @__PURE__ */ Symbol(`toHandlers` );
const CAMELIZE = /* @__PURE__ */ Symbol(`camelize` );
const CAPITALIZE = /* @__PURE__ */ Symbol(`capitalize` );
const TO_HANDLER_KEY = /* @__PURE__ */ Symbol(
  `toHandlerKey` 
);
const SET_BLOCK_TRACKING = Symbol(
const SET_BLOCK_TRACKING = /* @__PURE__ */ Symbol(
  `setBlockTracking` 
);
const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
const POP_SCOPE_ID = Symbol(`popScopeId` );
const WITH_CTX = Symbol(`withCtx` );
const UNREF = Symbol(`unref` );
const IS_REF = Symbol(`isRef` );
const WITH_MEMO = Symbol(`withMemo` );
const IS_MEMO_SAME = Symbol(`isMemoSame` );
const PUSH_SCOPE_ID = /* @__PURE__ */ Symbol(`pushScopeId` );
const POP_SCOPE_ID = /* @__PURE__ */ Symbol(`popScopeId` );
const WITH_CTX = /* @__PURE__ */ Symbol(`withCtx` );
const UNREF = /* @__PURE__ */ Symbol(`unref` );
const IS_REF = /* @__PURE__ */ Symbol(`isRef` );
const WITH_MEMO = /* @__PURE__ */ Symbol(`withMemo` );
const IS_MEMO_SAME = /* @__PURE__ */ Symbol(`isMemoSame` );
const helperNameMap = {
  [FRAGMENT]: `Fragment`,
  [TELEPORT]: `Teleport`,
@@ -486,8 +486,8 @@
    this.currentSequence = void 0;
    this.sequenceIndex = 0;
    {
      this.entityDecoder = new decode_js.EntityDecoder(
        decode_js.htmlDecodeTree,
      this.entityDecoder = new decode.EntityDecoder(
        decode.htmlDecodeTree,
        (cp, consumed) => this.emitCodePoint(cp, consumed)
      );
    }
@@ -517,13 +517,27 @@
  getPos(index) {
    let line = 1;
    let column = index + 1;
    for (let i = this.newlines.length - 1; i >= 0; i--) {
      const newlineIndex = this.newlines[i];
      if (index > newlineIndex) {
        line = i + 2;
        column = index - newlineIndex;
        break;
    const length = this.newlines.length;
    let j = -1;
    if (length > 100) {
      let l = -1;
      let r = length;
      while (l + 1 < r) {
        const m = l + r >>> 1;
        this.newlines[m] < index ? l = m : r = m;
      }
      j = l;
    } else {
      for (let i = length - 1; i >= 0; i--) {
        if (index > this.newlines[i]) {
          j = i;
          break;
        }
      }
    }
    if (j >= 0) {
      line = j + 2;
      column = index - this.newlines[j];
    }
    return {
      column,
@@ -1037,7 +1051,7 @@
      this.state = 33;
      this.entityStart = this.index;
      this.entityDecoder.startEntity(
        this.baseState === 1 || this.baseState === 32 ? decode_js.DecodingMode.Legacy : decode_js.DecodingMode.Attribute
        this.baseState === 1 || this.baseState === 32 ? decode.DecodingMode.Legacy : decode.DecodingMode.Attribute
      );
    }
  }
@@ -1256,7 +1270,7 @@
        this.sectionStart = this.entityStart + consumed;
        this.index = this.sectionStart - 1;
        this.cbs.onattribentity(
          decode_js.fromCodePoint(cp),
          decode.fromCodePoint(cp),
          this.entityStart,
          this.sectionStart
        );
@@ -1267,7 +1281,7 @@
        this.sectionStart = this.entityStart + consumed;
        this.index = this.sectionStart - 1;
        this.cbs.ontextentity(
          decode_js.fromCodePoint(cp),
          decode.fromCodePoint(cp),
          this.entityStart,
          this.sectionStart
        );
@@ -1457,24 +1471,26 @@
  "43": "X_V_MODEL_ON_SCOPE_VARIABLE",
  "X_V_MODEL_ON_PROPS": 44,
  "44": "X_V_MODEL_ON_PROPS",
  "X_INVALID_EXPRESSION": 45,
  "45": "X_INVALID_EXPRESSION",
  "X_KEEP_ALIVE_INVALID_CHILDREN": 46,
  "46": "X_KEEP_ALIVE_INVALID_CHILDREN",
  "X_PREFIX_ID_NOT_SUPPORTED": 47,
  "47": "X_PREFIX_ID_NOT_SUPPORTED",
  "X_MODULE_MODE_NOT_SUPPORTED": 48,
  "48": "X_MODULE_MODE_NOT_SUPPORTED",
  "X_CACHE_HANDLER_NOT_SUPPORTED": 49,
  "49": "X_CACHE_HANDLER_NOT_SUPPORTED",
  "X_SCOPE_ID_NOT_SUPPORTED": 50,
  "50": "X_SCOPE_ID_NOT_SUPPORTED",
  "X_VNODE_HOOKS": 51,
  "51": "X_VNODE_HOOKS",
  "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52,
  "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
  "__EXTEND_POINT__": 53,
  "53": "__EXTEND_POINT__"
  "X_V_MODEL_ON_CONST": 45,
  "45": "X_V_MODEL_ON_CONST",
  "X_INVALID_EXPRESSION": 46,
  "46": "X_INVALID_EXPRESSION",
  "X_KEEP_ALIVE_INVALID_CHILDREN": 47,
  "47": "X_KEEP_ALIVE_INVALID_CHILDREN",
  "X_PREFIX_ID_NOT_SUPPORTED": 48,
  "48": "X_PREFIX_ID_NOT_SUPPORTED",
  "X_MODULE_MODE_NOT_SUPPORTED": 49,
  "49": "X_MODULE_MODE_NOT_SUPPORTED",
  "X_CACHE_HANDLER_NOT_SUPPORTED": 50,
  "50": "X_CACHE_HANDLER_NOT_SUPPORTED",
  "X_SCOPE_ID_NOT_SUPPORTED": 51,
  "51": "X_SCOPE_ID_NOT_SUPPORTED",
  "X_VNODE_HOOKS": 52,
  "52": "X_VNODE_HOOKS",
  "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 53,
  "53": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
  "__EXTEND_POINT__": 54,
  "54": "__EXTEND_POINT__"
};
const errorMessages = {
  // parse errors
@@ -1515,7 +1531,7 @@
  [32]: `v-for has invalid expression.`,
  [33]: `<template v-for> key should be placed on the <template> tag.`,
  [34]: `v-bind is missing expression.`,
  [52]: `v-bind with same-name shorthand only allows static argument.`,
  [53]: `v-bind with same-name shorthand only allows static argument.`,
  [35]: `v-on is missing expression.`,
  [36]: `Unexpected custom directive on <slot> outlet.`,
  [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
@@ -1527,16 +1543,17 @@
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
  [45]: `Error parsing JavaScript expression: `,
  [46]: `<KeepAlive> expects exactly one child component.`,
  [51]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
  [46]: `Error parsing JavaScript expression: `,
  [47]: `<KeepAlive> expects exactly one child component.`,
  [52]: `@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.`,
  // generic errors
  [47]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
  [48]: `ES module mode is not supported in this build of compiler.`,
  [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
  [50]: `"scopeId" option is only supported in module mode.`,
  [48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
  [49]: `ES module mode is not supported in this build of compiler.`,
  [50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
  [51]: `"scopeId" option is only supported in module mode.`,
  // just to fulfill types
  [53]: ``
  [54]: ``
};
function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
@@ -2326,7 +2343,7 @@
    let exp = getSlice(innerStart, innerEnd);
    if (exp.includes("&")) {
      {
        exp = decode_js.decodeHTML(exp);
        exp = decode.decodeHTML(exp);
      }
    }
    addNode({
@@ -2987,7 +3004,7 @@
      }
    } catch (e) {
      exp.ast = false;
      emitError(45, loc.start.offset, e.message);
      emitError(46, loc.start.offset, e.message);
    }
  }
  return exp;
@@ -4560,7 +4577,7 @@
    } catch (e) {
      context.onError(
        createCompilerError(
          45,
          46,
          node.loc,
          void 0,
          e.message
@@ -5001,7 +5018,7 @@
          loop.body = createBlockStatement([
            createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
            createCompoundExpression([
              `if (_cached`,
              `if (_cached && _cached.el`,
              ...keyExp ? [` && _cached.key === `, keyExp] : [],
              ` && ${context.helperString(
                IS_MEMO_SAME
@@ -5444,7 +5461,7 @@
        patchFlag |= 1024;
        if (node.children.length > 1) {
          context.onError(
            createCompilerError(46, {
            createCompilerError(47, {
              start: node.children[0].loc.start,
              end: node.children[node.children.length - 1].loc.end,
              source: ""
@@ -6107,7 +6124,7 @@
    if (arg.isStatic) {
      let rawName = arg.content;
      if (rawName.startsWith("vnode")) {
        context.onError(createCompilerError(51, arg.loc));
        context.onError(createCompilerError(52, arg.loc));
      }
      if (rawName.startsWith("vue:")) {
        rawName = `vnode-${rawName.slice(4)}`;
@@ -6369,6 +6386,10 @@
    context.onError(createCompilerError(44, exp.loc));
    return createTransformProps();
  }
  if (bindingType === "literal-const" || bindingType === "setup-const") {
    context.onError(createCompilerError(45, exp.loc));
    return createTransformProps();
  }
  const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref");
  if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) {
    context.onError(
@@ -6622,7 +6643,7 @@
        if (arg.type !== 4 || !arg.isStatic) {
          context.onError(
            createCompilerError(
              52,
              53,
              arg.loc
            )
          );
@@ -6670,10 +6691,10 @@
  const isModuleMode = options.mode === "module";
  const prefixIdentifiers = options.prefixIdentifiers === true || isModuleMode;
  if (!prefixIdentifiers && options.cacheHandlers) {
    onError(createCompilerError(49));
    onError(createCompilerError(50));
  }
  if (options.scopeId && !isModuleMode) {
    onError(createCompilerError(50));
    onError(createCompilerError(51));
  }
  const resolvedOptions = shared.extend({}, options, {
    prefixIdentifiers