@@ -20,9 +20,8 @@ export { default as preprocess } from './preprocess/index.js';
2020 */
2121export function compile ( source , options ) {
2222 source = remove_bom ( source ) ;
23- state . reset_warning_filter ( options . warningFilter ) ;
23+ state . reset_warnings ( options . warningFilter ) ;
2424 const validated = validate_component_options ( options , '' ) ;
25- state . reset ( source , validated ) ;
2625
2726 let parsed = _parse ( source ) ;
2827
@@ -64,9 +63,8 @@ export function compile(source, options) {
6463 */
6564export function compileModule ( source , options ) {
6665 source = remove_bom ( source ) ;
67- state . reset_warning_filter ( options . warningFilter ) ;
66+ state . reset_warnings ( options . warningFilter ) ;
6867 const validated = validate_module_options ( options , '' ) ;
69- state . reset ( source , validated ) ;
7068
7169 const analysis = analyze_module ( source , validated ) ;
7270 return transform_module ( analysis , source , validated ) ;
@@ -96,6 +94,7 @@ export function compileModule(source, options) {
9694 * @returns {Record<string, any> }
9795 */
9896
97+ // TODO 6.0 remove unused `filename`
9998/**
10099 * The parse function parses a component, returning only its abstract syntax tree.
101100 *
@@ -104,14 +103,15 @@ export function compileModule(source, options) {
104103 *
105104 * The `loose` option, available since 5.13.0, tries to always return an AST even if the input will not successfully compile.
106105 *
106+ * The `filename` option is unused and will be removed in Svelte 6.0.
107+ *
107108 * @param {string } source
108109 * @param {{ filename?: string; rootDir?: string; modern?: boolean; loose?: boolean } } [options]
109110 * @returns {AST.Root | LegacyRoot }
110111 */
111- export function parse ( source , { filename , rootDir , modern, loose } = { } ) {
112+ export function parse ( source , { modern, loose } = { } ) {
112113 source = remove_bom ( source ) ;
113- state . reset_warning_filter ( ( ) => false ) ;
114- state . reset ( source , { filename : filename ?? '(unknown)' , rootDir } ) ;
114+ state . reset_warnings ( ( ) => false ) ;
115115
116116 const ast = _parse ( source , loose ) ;
117117 return to_public_ast ( source , ast , modern ) ;
0 commit comments