Skip to content

Commit 0dc08f5

Browse files
committed
chore: move remove_typescript_nodes in the same place as the rest
1 parent e8267f4 commit 0dc08f5

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

packages/svelte/src/compiler/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export function compile(source, options) {
4343
instance: parsed.instance && remove_typescript_nodes(parsed.instance),
4444
module: parsed.module && remove_typescript_nodes(parsed.module)
4545
};
46+
if (combined_options.customElementOptions?.extend) {
47+
combined_options.customElementOptions.extend = remove_typescript_nodes(
48+
combined_options.customElementOptions?.extend
49+
);
50+
}
4651
}
4752

4853
const analysis = analyze_component(parsed, source, combined_options);

packages/svelte/src/compiler/phases/1-parse/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export class Parser {
143143
if (options_index !== -1) {
144144
const options = /** @type {AST.SvelteOptionsRaw} */ (this.root.fragment.nodes[options_index]);
145145
this.root.fragment.nodes.splice(options_index, 1);
146-
this.root.options = read_options(options, this.ts);
146+
this.root.options = read_options(options);
147147

148148
disallow_children(options);
149149

packages/svelte/src/compiler/phases/1-parse/read/options.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
/** @import { AST } from '#compiler' */
33
import { NAMESPACE_MATHML, NAMESPACE_SVG } from '../../../../constants.js';
44
import * as e from '../../../errors.js';
5-
import { remove_typescript_nodes } from '../remove_typescript_nodes.js';
65

76
/**
87
* @param {AST.SvelteOptionsRaw} node
9-
* @param {boolean} ts
108
* @returns {AST.Root['options']}
119
*/
12-
export default function read_options(node, ts) {
10+
export default function read_options(node) {
1311
/** @type {AST.SvelteOptions} */
1412
const component_options = {
1513
start: node.start,
@@ -144,7 +142,7 @@ export default function read_options(node, ts) {
144142

145143
const extend = properties.find(([name]) => name === 'extend')?.[1];
146144
if (extend) {
147-
ce.extend = ts ? remove_typescript_nodes(extend) : extend;
145+
ce.extend = extend;
148146
}
149147

150148
component_options.customElement = ce;

0 commit comments

Comments
 (0)