Skip to content

Commit 462b6ee

Browse files
committed
fix generated type
1 parent b91a67b commit 462b6ee

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

packages/svelte/src/compiler/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getLocator } from 'locate-character';
2-
import { walk } from 'zimmerframe';
2+
import { walk as zimmerframe_walk } from 'zimmerframe';
33
import { CompileError } from './errors.js';
44
import { convert } from './legacy.js';
55
import { parse as parse_acorn } from './phases/1-parse/acorn.js';
@@ -133,7 +133,7 @@ export function parse(source, options = {}) {
133133
function to_public_ast(source, ast, modern) {
134134
if (modern) {
135135
// remove things that we don't want to treat as public API
136-
return walk(ast, null, {
136+
return zimmerframe_walk(ast, null, {
137137
_(node, { next }) {
138138
// @ts-ignore
139139
delete node.parent;
@@ -151,14 +151,12 @@ function to_public_ast(source, ast, modern) {
151151
* @deprecated Replace this with `import { walk } from 'estree-walker'`
152152
* @returns {never}
153153
*/
154-
function _walk() {
154+
export function walk() {
155155
throw new Error(
156156
`'svelte/compiler' no longer exports a \`walk\` utility — please import it directly from 'estree-walker' instead`
157157
);
158158
}
159159

160-
export { _walk as walk };
161-
162160
export { CompileError } from './errors.js';
163161

164162
export { VERSION } from '../version.js';

packages/svelte/types/index.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ declare module 'svelte/compiler' {
507507
/**
508508
* @deprecated Replace this with `import { walk } from 'estree-walker'`
509509
* */
510-
function walk(): never;
510+
export function walk(): never;
511511
/** The return value of `compile` from `svelte/compiler` */
512512
interface CompileResult {
513513
/** The compiled JavaScript */
@@ -1762,8 +1762,6 @@ declare module 'svelte/compiler' {
17621762
style?: Preprocessor;
17631763
script?: Preprocessor;
17641764
}
1765-
1766-
export { walk };
17671765
}
17681766

17691767
declare module 'svelte/easing' {

0 commit comments

Comments
 (0)