@@ -20,9 +20,8 @@ export { default as preprocess } from './preprocess/index.js';
20
20
*/
21
21
export function compile ( source , options ) {
22
22
source = remove_bom ( source ) ;
23
- state . reset_warning_filter ( options . warningFilter ) ;
23
+ state . reset_warnings ( options . warningFilter ) ;
24
24
const validated = validate_component_options ( options , '' ) ;
25
- state . reset ( source , validated ) ;
26
25
27
26
let parsed = _parse ( source ) ;
28
27
@@ -64,9 +63,8 @@ export function compile(source, options) {
64
63
*/
65
64
export function compileModule ( source , options ) {
66
65
source = remove_bom ( source ) ;
67
- state . reset_warning_filter ( options . warningFilter ) ;
66
+ state . reset_warnings ( options . warningFilter ) ;
68
67
const validated = validate_module_options ( options , '' ) ;
69
- state . reset ( source , validated ) ;
70
68
71
69
const analysis = analyze_module ( source , validated ) ;
72
70
return transform_module ( analysis , source , validated ) ;
@@ -96,6 +94,7 @@ export function compileModule(source, options) {
96
94
* @returns {Record<string, any> }
97
95
*/
98
96
97
+ // TODO 6.0 remove unused `filename`
99
98
/**
100
99
* The parse function parses a component, returning only its abstract syntax tree.
101
100
*
@@ -104,14 +103,15 @@ export function compileModule(source, options) {
104
103
*
105
104
* The `loose` option, available since 5.13.0, tries to always return an AST even if the input will not successfully compile.
106
105
*
106
+ * The `filename` option is unused and will be removed in Svelte 6.0.
107
+ *
107
108
* @param {string } source
108
109
* @param {{ filename?: string; rootDir?: string; modern?: boolean; loose?: boolean } } [options]
109
110
* @returns {AST.Root | LegacyRoot }
110
111
*/
111
- export function parse ( source , { filename , rootDir , modern, loose } = { } ) {
112
+ export function parse ( source , { modern, loose } = { } ) {
112
113
source = remove_bom ( source ) ;
113
- state . reset_warning_filter ( ( ) => false ) ;
114
- state . reset ( source , { filename : filename ?? '(unknown)' , rootDir } ) ;
114
+ state . reset_warnings ( ( ) => false ) ;
115
115
116
116
const ast = _parse ( source , loose ) ;
117
117
return to_public_ast ( source , ast , modern ) ;
0 commit comments