@vue/compiler-core 3.6.0-rc.13 → 3.6.0-rc.14

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-rc.13
2
+ * @vue/compiler-core v3.6.0-rc.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2141,6 +2141,13 @@ const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
2141
2141
  const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
2142
2142
  const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
2143
2143
  const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
2144
+ const asciiIdentifierRE = /^[A-Za-z_$][\w$]*$/;
2145
+ const isReservedWord = /*@__PURE__*/ (0, _vue_shared.makeMap)("await,break,case,catch,class,const,continue,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield");
2146
+ const isUnparsedIdentifier = (exp) => {
2147
+ if (exp.ast !== null) return false;
2148
+ const content = getExpSource(exp);
2149
+ return asciiIdentifierRE.test(content) && !isReservedWord(content);
2150
+ };
2144
2151
  /**
2145
2152
  * Simple lexer to check if an expression is a member expression. This is
2146
2153
  * lax and only checks validity at the root level (i.e. does not validate exps
@@ -2198,6 +2205,7 @@ const isMemberExpressionBrowser = (exp) => {
2198
2205
  return !currentOpenBracketCount && !currentOpenParensCount;
2199
2206
  };
2200
2207
  const isMemberExpressionNode = (exp, context) => {
2208
+ if (isUnparsedIdentifier(exp)) return true;
2201
2209
  try {
2202
2210
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
2203
2211
  ret = unwrapTSNode(ret);
@@ -2210,6 +2218,7 @@ const isMemberExpression = isMemberExpressionNode;
2210
2218
  const fnExpRE = /^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/;
2211
2219
  const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
2212
2220
  const isFnExpressionNode = (exp, context) => {
2221
+ if (isUnparsedIdentifier(exp)) return false;
2213
2222
  try {
2214
2223
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
2215
2224
  if (ret.type === "Program") {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-rc.13
2
+ * @vue/compiler-core v3.6.0-rc.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2137,6 +2137,13 @@ const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
2137
2137
  const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
2138
2138
  const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
2139
2139
  const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
2140
+ const asciiIdentifierRE = /^[A-Za-z_$][\w$]*$/;
2141
+ const isReservedWord = /*@__PURE__*/ (0, _vue_shared.makeMap)("await,break,case,catch,class,const,continue,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield");
2142
+ const isUnparsedIdentifier = (exp) => {
2143
+ if (exp.ast !== null) return false;
2144
+ const content = getExpSource(exp);
2145
+ return asciiIdentifierRE.test(content) && !isReservedWord(content);
2146
+ };
2140
2147
  /**
2141
2148
  * Simple lexer to check if an expression is a member expression. This is
2142
2149
  * lax and only checks validity at the root level (i.e. does not validate exps
@@ -2194,6 +2201,7 @@ const isMemberExpressionBrowser = (exp) => {
2194
2201
  return !currentOpenBracketCount && !currentOpenParensCount;
2195
2202
  };
2196
2203
  const isMemberExpressionNode = (exp, context) => {
2204
+ if (isUnparsedIdentifier(exp)) return true;
2197
2205
  try {
2198
2206
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
2199
2207
  ret = unwrapTSNode(ret);
@@ -2206,6 +2214,7 @@ const isMemberExpression = isMemberExpressionNode;
2206
2214
  const fnExpRE = /^\s*(?:async\s*)?(?:\([^)]*?\)|[\w$_]+)\s*(?::[^=]+)?=>|^\s*(?:async\s+)?function(?:\s+[\w$]+)?\s*\(/;
2207
2215
  const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
2208
2216
  const isFnExpressionNode = (exp, context) => {
2217
+ if (isUnparsedIdentifier(exp)) return false;
2209
2218
  try {
2210
2219
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
2211
2220
  if (ret.type === "Program") {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.6.0-rc.13
2
+ * @vue/compiler-core v3.6.0-rc.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.6.0-rc.13",
3
+ "version": "3.6.0-rc.14",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -47,7 +47,7 @@
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
48
48
  "dependencies": {
49
49
  "@babel/parser": "^7.29.9",
50
- "@vue/shared": "3.6.0-rc.13",
50
+ "@vue/shared": "3.6.0-rc.14",
51
51
  "entities": "^7.0.1",
52
52
  "estree-walker": "^2.0.2",
53
53
  "source-map-js": "^1.2.2"