@vue/compat 3.4.37 → 3.4.38

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.
package/dist/vue.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.4.37
2
+ * @vue/compat v3.4.38
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -7,7 +7,7 @@
7
7
 
8
8
  var parser = require('@babel/parser');
9
9
  var estreeWalker = require('estree-walker');
10
- var decode_js = require('entities/dist/decode.js');
10
+ var decode_js = require('entities/lib/decode.js');
11
11
  var sourceMapJs = require('source-map-js');
12
12
 
13
13
  /*! #__NO_SIDE_EFFECTS__ */
@@ -5307,7 +5307,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5307
5307
  return vm;
5308
5308
  }
5309
5309
  }
5310
- Vue.version = `2.6.14-compat:${"3.4.37"}`;
5310
+ Vue.version = `2.6.14-compat:${"3.4.38"}`;
5311
5311
  Vue.config = singletonApp.config;
5312
5312
  Vue.use = (plugin, ...options) => {
5313
5313
  if (plugin && isFunction(plugin.install)) {
@@ -11529,7 +11529,7 @@ function isMemoSame(cached, memo) {
11529
11529
  return true;
11530
11530
  }
11531
11531
 
11532
- const version = "3.4.37";
11532
+ const version = "3.4.38";
11533
11533
  const warn = warn$1 ;
11534
11534
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11535
11535
  const devtools = devtools$1 ;
@@ -14978,10 +14978,11 @@ function isCoreComponent(tag) {
14978
14978
  }
14979
14979
  const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
14980
14980
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
14981
- const isMemberExpressionNode = (path, context) => {
14981
+ const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
14982
+ const isMemberExpressionNode = (exp, context) => {
14982
14983
  try {
14983
- let ret = parser.parseExpression(path, {
14984
- plugins: context.expressionPlugins
14984
+ let ret = exp.ast || parser.parseExpression(getExpSource(exp), {
14985
+ plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"]
14985
14986
  });
14986
14987
  ret = unwrapTSNode(ret);
14987
14988
  return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier" && ret.name !== "undefined";
@@ -14990,6 +14991,24 @@ const isMemberExpressionNode = (path, context) => {
14990
14991
  }
14991
14992
  };
14992
14993
  const isMemberExpression = isMemberExpressionNode;
14994
+ const isFnExpressionNode = (exp, context) => {
14995
+ try {
14996
+ let ret = exp.ast || parser.parseExpression(getExpSource(exp), {
14997
+ plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"]
14998
+ });
14999
+ if (ret.type === "Program") {
15000
+ ret = ret.body[0];
15001
+ if (ret.type === "ExpressionStatement") {
15002
+ ret = ret.expression;
15003
+ }
15004
+ }
15005
+ ret = unwrapTSNode(ret);
15006
+ return ret.type === "FunctionExpression" || ret.type === "ArrowFunctionExpression";
15007
+ } catch (e) {
15008
+ return false;
15009
+ }
15010
+ };
15011
+ const isFnExpression = isFnExpressionNode;
14993
15012
  function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
14994
15013
  return advancePositionWithMutation(
14995
15014
  {
@@ -19050,7 +19069,6 @@ function processSlotOutlet(node, context) {
19050
19069
  };
19051
19070
  }
19052
19071
 
19053
- const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
19054
19072
  const transformOn$1 = (dir, node, context, augmentor) => {
19055
19073
  const { loc, modifiers, arg } = dir;
19056
19074
  if (!dir.exp && !modifiers.length) {
@@ -19094,8 +19112,8 @@ const transformOn$1 = (dir, node, context, augmentor) => {
19094
19112
  }
19095
19113
  let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
19096
19114
  if (exp) {
19097
- const isMemberExp = isMemberExpression(exp.content, context);
19098
- const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
19115
+ const isMemberExp = isMemberExpression(exp, context);
19116
+ const isInlineStatement = !(isMemberExp || isFnExpression(exp, context));
19099
19117
  const hasMultipleStatements = exp.content.includes(`;`);
19100
19118
  if (context.prefixIdentifiers) {
19101
19119
  isInlineStatement && context.addIdentifiers(`$event`);
@@ -19265,7 +19283,7 @@ const transformModel$1 = (dir, node, context) => {
19265
19283
  return createTransformProps();
19266
19284
  }
19267
19285
  const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref");
19268
- if (!expString.trim() || !isMemberExpression(expString, context) && !maybeRef) {
19286
+ if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) {
19269
19287
  context.onError(
19270
19288
  createCompilerError(42, exp.loc)
19271
19289
  );
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.4.37
2
+ * @vue/compat v3.4.38
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -7,7 +7,7 @@
7
7
 
8
8
  var parser = require('@babel/parser');
9
9
  var estreeWalker = require('estree-walker');
10
- var decode_js = require('entities/dist/decode.js');
10
+ var decode_js = require('entities/lib/decode.js');
11
11
  var sourceMapJs = require('source-map-js');
12
12
 
13
13
  /*! #__NO_SIDE_EFFECTS__ */
@@ -4155,7 +4155,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
4155
4155
  return vm;
4156
4156
  }
4157
4157
  }
4158
- Vue.version = `2.6.14-compat:${"3.4.37"}`;
4158
+ Vue.version = `2.6.14-compat:${"3.4.38"}`;
4159
4159
  Vue.config = singletonApp.config;
4160
4160
  Vue.use = (plugin, ...options) => {
4161
4161
  if (plugin && isFunction(plugin.install)) {
@@ -9176,7 +9176,7 @@ function isMemoSame(cached, memo) {
9176
9176
  return true;
9177
9177
  }
9178
9178
 
9179
- const version = "3.4.37";
9179
+ const version = "3.4.38";
9180
9180
  const warn$1 = NOOP;
9181
9181
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9182
9182
  const devtools = void 0;
@@ -12442,10 +12442,11 @@ function isCoreComponent(tag) {
12442
12442
  }
12443
12443
  const nonIdentifierRE = /^\d|[^\$\w\xA0-\uFFFF]/;
12444
12444
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
12445
- const isMemberExpressionNode = (path, context) => {
12445
+ const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
12446
+ const isMemberExpressionNode = (exp, context) => {
12446
12447
  try {
12447
- let ret = parser.parseExpression(path, {
12448
- plugins: context.expressionPlugins
12448
+ let ret = exp.ast || parser.parseExpression(getExpSource(exp), {
12449
+ plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"]
12449
12450
  });
12450
12451
  ret = unwrapTSNode(ret);
12451
12452
  return ret.type === "MemberExpression" || ret.type === "OptionalMemberExpression" || ret.type === "Identifier" && ret.name !== "undefined";
@@ -12454,6 +12455,24 @@ const isMemberExpressionNode = (path, context) => {
12454
12455
  }
12455
12456
  };
12456
12457
  const isMemberExpression = isMemberExpressionNode;
12458
+ const isFnExpressionNode = (exp, context) => {
12459
+ try {
12460
+ let ret = exp.ast || parser.parseExpression(getExpSource(exp), {
12461
+ plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"]
12462
+ });
12463
+ if (ret.type === "Program") {
12464
+ ret = ret.body[0];
12465
+ if (ret.type === "ExpressionStatement") {
12466
+ ret = ret.expression;
12467
+ }
12468
+ }
12469
+ ret = unwrapTSNode(ret);
12470
+ return ret.type === "FunctionExpression" || ret.type === "ArrowFunctionExpression";
12471
+ } catch (e) {
12472
+ return false;
12473
+ }
12474
+ };
12475
+ const isFnExpression = isFnExpressionNode;
12457
12476
  function advancePositionWithClone(pos, source, numberOfCharacters = source.length) {
12458
12477
  return advancePositionWithMutation(
12459
12478
  {
@@ -16395,7 +16414,6 @@ function processSlotOutlet(node, context) {
16395
16414
  };
16396
16415
  }
16397
16416
 
16398
- const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
16399
16417
  const transformOn$1 = (dir, node, context, augmentor) => {
16400
16418
  const { loc, modifiers, arg } = dir;
16401
16419
  if (!dir.exp && !modifiers.length) {
@@ -16436,8 +16454,8 @@ const transformOn$1 = (dir, node, context, augmentor) => {
16436
16454
  }
16437
16455
  let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
16438
16456
  if (exp) {
16439
- const isMemberExp = isMemberExpression(exp.content, context);
16440
- const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
16457
+ const isMemberExp = isMemberExpression(exp, context);
16458
+ const isInlineStatement = !(isMemberExp || isFnExpression(exp, context));
16441
16459
  const hasMultipleStatements = exp.content.includes(`;`);
16442
16460
  if (context.prefixIdentifiers) {
16443
16461
  isInlineStatement && context.addIdentifiers(`$event`);
@@ -16607,7 +16625,7 @@ const transformModel$1 = (dir, node, context) => {
16607
16625
  return createTransformProps();
16608
16626
  }
16609
16627
  const maybeRef = context.inline && (bindingType === "setup-let" || bindingType === "setup-ref" || bindingType === "setup-maybe-ref");
16610
- if (!expString.trim() || !isMemberExpression(expString, context) && !maybeRef) {
16628
+ if (!expString.trim() || !isMemberExpression(exp, context) && !maybeRef) {
16611
16629
  context.onError(
16612
16630
  createCompilerError(42, exp.loc)
16613
16631
  );
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.4.37
2
+ * @vue/compat v3.4.38
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -5250,7 +5250,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5250
5250
  return vm;
5251
5251
  }
5252
5252
  }
5253
- Vue.version = `2.6.14-compat:${"3.4.37"}`;
5253
+ Vue.version = `2.6.14-compat:${"3.4.38"}`;
5254
5254
  Vue.config = singletonApp.config;
5255
5255
  Vue.use = (plugin, ...options) => {
5256
5256
  if (plugin && isFunction(plugin.install)) {
@@ -11438,7 +11438,7 @@ function isMemoSame(cached, memo) {
11438
11438
  return true;
11439
11439
  }
11440
11440
 
11441
- const version = "3.4.37";
11441
+ const version = "3.4.38";
11442
11442
  const warn = warn$1 ;
11443
11443
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11444
11444
  const devtools = devtools$1 ;
@@ -14545,8 +14545,9 @@ const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
14545
14545
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
14546
14546
  const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
14547
14547
  const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
14548
- const isMemberExpressionBrowser = (path) => {
14549
- path = path.trim().replace(whitespaceRE, (s) => s.trim());
14548
+ const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
14549
+ const isMemberExpressionBrowser = (exp) => {
14550
+ const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());
14550
14551
  let state = 0 /* inMemberExp */;
14551
14552
  let stateStack = [];
14552
14553
  let currentOpenBracketCount = 0;
@@ -14608,6 +14609,9 @@ const isMemberExpressionBrowser = (path) => {
14608
14609
  return !currentOpenBracketCount && !currentOpenParensCount;
14609
14610
  };
14610
14611
  const isMemberExpression = isMemberExpressionBrowser ;
14612
+ const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
14613
+ const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
14614
+ const isFnExpression = isFnExpressionBrowser ;
14611
14615
  function assert(condition, msg) {
14612
14616
  if (!condition) {
14613
14617
  throw new Error(msg || `unexpected compiler condition`);
@@ -18044,7 +18048,6 @@ function processSlotOutlet(node, context) {
18044
18048
  };
18045
18049
  }
18046
18050
 
18047
- const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
18048
18051
  const transformOn$1 = (dir, node, context, augmentor) => {
18049
18052
  const { loc, modifiers, arg } = dir;
18050
18053
  if (!dir.exp && !modifiers.length) {
@@ -18088,8 +18091,8 @@ const transformOn$1 = (dir, node, context, augmentor) => {
18088
18091
  }
18089
18092
  let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
18090
18093
  if (exp) {
18091
- const isMemberExp = isMemberExpression(exp.content);
18092
- const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
18094
+ const isMemberExp = isMemberExpression(exp);
18095
+ const isInlineStatement = !(isMemberExp || isFnExpression(exp));
18093
18096
  const hasMultipleStatements = exp.content.includes(`;`);
18094
18097
  {
18095
18098
  validateBrowserExpression(
@@ -18237,7 +18240,7 @@ const transformModel$1 = (dir, node, context) => {
18237
18240
  return createTransformProps();
18238
18241
  }
18239
18242
  const maybeRef = false;
18240
- if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) {
18243
+ if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) {
18241
18244
  context.onError(
18242
18245
  createCompilerError(42, exp.loc)
18243
18246
  );