Skip to content

Commit

Permalink
revert fix
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Oct 7, 2023
1 parent 352f35a commit eeaac3f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion packages/vue-language-core/src/generators/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,6 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
},
emptyLocalVars,
identifiers,
new Set(),
vueCompilerOptions,
);
codes.push(';\n');
Expand Down
3 changes: 1 addition & 2 deletions packages/vue-language-core/src/generators/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ export function generate(
sfc: Sfc,
hasScriptSetupSlots: boolean,
slotsAssignName: string | undefined,
propsAssignName: string | undefined,
codegenStack: boolean,
) {

Expand Down Expand Up @@ -1893,7 +1892,7 @@ export function generate(
}
codes.push(addSuffix);
}
}, localVars, identifiers, new Set([propsAssignName ?? '']), vueCompilerOptions);
}, localVars, identifiers, vueCompilerOptions);
if (start !== undefined) {
for (const v of vars) {
v.offset = start + v.offset - prefix.length;
Expand Down
3 changes: 0 additions & 3 deletions packages/vue-language-core/src/plugins/vue-tsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,18 @@ function createTsx(fileName: string, _sfc: Sfc, { vueCompilerOptions, compilerOp
_sfc,
hasScriptSetupSlots.value,
slotsAssignName.value,
propsAssignName.value,
codegenStack,
);
});

//#region remove when https://github.com/vuejs/core/pull/5912 merged
const hasScriptSetupSlots = ref(false);
const slotsAssignName = ref<string>();
const propsAssignName = ref<string>();
//#endregion

const tsxGen = computed(() => {
hasScriptSetupSlots.value = !!scriptSetupRanges.value?.defineSlots;
slotsAssignName.value = scriptSetupRanges.value?.slotsAssignName;
propsAssignName.value = scriptSetupRanges.value?.propsAssignName;
return genScript(
ts,
fileName,
Expand Down
2 changes: 0 additions & 2 deletions packages/vue-language-core/src/utils/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export function walkInterpolationFragment(
cb: (fragment: string, offset: number | undefined, isJustForErrorMapping?: boolean) => void,
localVars: Record<string, number>,
identifiers: Set<string>,
skipVars: Set<string>,
vueOptions: VueCompilerOptions,
) {

Expand All @@ -22,7 +21,6 @@ export function walkInterpolationFragment(
const varCb = (id: ts.Identifier, isShorthand: boolean) => {
if (
!!localVars[id.text] ||
skipVars.has(id.text) ||
// https://github.com/vuejs/core/blob/245230e135152900189f13a4281302de45fdcfaa/packages/compiler-core/src/transforms/transformExpression.ts#L342-L352
isGloballyWhitelisted(id.text) ||
id.text === 'require' ||
Expand Down

0 comments on commit eeaac3f

Please sign in to comment.