chore: update acorn parser `ecmaVersion` to parse import attributes (#16098)

* bump acorn parser version

* fix failing tests

* lint
pull/16101/head
ComputerGuy 3 months ago committed by GitHub
parent 2bbaaa361b
commit 0741ee65d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
chore: update acorn parser `ecmaVersion` to parse import attributes

@ -36,7 +36,7 @@ export function parse(source, typescript, is_script) {
ast = parser.parse(source, { ast = parser.parse(source, {
onComment, onComment,
sourceType: 'module', sourceType: 'module',
ecmaVersion: 13, ecmaVersion: 16,
locations: true locations: true
}); });
} finally { } finally {
@ -64,7 +64,7 @@ export function parse_expression_at(source, typescript, index) {
const ast = parser.parseExpressionAt(source, index, { const ast = parser.parseExpressionAt(source, index, {
onComment, onComment,
sourceType: 'module', sourceType: 'module',
ecmaVersion: 13, ecmaVersion: 16,
locations: true locations: true
}); });

@ -15,16 +15,16 @@
"end": 20, "end": 20,
"type": "Action", "type": "Action",
"name": "autofocus", "name": "autofocus",
"modifiers": [], "expression": null,
"expression": null "modifiers": []
}, },
{ {
"start": 21, "start": 21,
"end": 34, "end": 34,
"type": "Action", "type": "Action",
"name": "autofocus", "name": "autofocus",
"modifiers": [], "expression": null,
"expression": null "modifiers": []
} }
], ],
"children": [] "children": []

@ -15,7 +15,6 @@
"end": 39, "end": 39,
"type": "Action", "type": "Action",
"name": "tooltip", "name": "tooltip",
"modifiers": [],
"expression": { "expression": {
"type": "CallExpression", "type": "CallExpression",
"start": 21, "start": 21,
@ -66,7 +65,8 @@
} }
], ],
"optional": false "optional": false
} },
"modifiers": []
} }
], ],
"children": [] "children": []

@ -15,7 +15,6 @@
"end": 28, "end": 28,
"type": "Action", "type": "Action",
"name": "tooltip", "name": "tooltip",
"modifiers": [],
"expression": { "expression": {
"type": "Identifier", "type": "Identifier",
"start": 20, "start": 20,
@ -31,7 +30,8 @@
} }
}, },
"name": "message" "name": "message"
} },
"modifiers": []
} }
], ],
"children": [] "children": []

@ -15,7 +15,6 @@
"end": 36, "end": 36,
"type": "Action", "type": "Action",
"name": "tooltip", "name": "tooltip",
"modifiers": [],
"expression": { "expression": {
"type": "Literal", "type": "Literal",
"start": 21, "start": 21,
@ -32,7 +31,8 @@
}, },
"value": "tooltip msg", "value": "tooltip msg",
"raw": "'tooltip msg'" "raw": "'tooltip msg'"
} },
"modifiers": []
} }
], ],
"children": [] "children": []

@ -15,8 +15,8 @@
"end": 20, "end": 20,
"type": "Action", "type": "Action",
"name": "autofocus", "name": "autofocus",
"modifiers": [], "expression": null,
"expression": null "modifiers": []
} }
], ],
"children": [] "children": []

@ -20,8 +20,8 @@
"end": 50, "end": 50,
"type": "Animation", "type": "Animation",
"name": "flip", "name": "flip",
"modifiers": [], "expression": null,
"expression": null "modifiers": []
} }
], ],
"children": [ "children": [

@ -15,7 +15,6 @@
"end": 22, "end": 22,
"type": "Class", "type": "Class",
"name": "foo", "name": "foo",
"modifiers": [],
"expression": { "expression": {
"type": "Identifier", "type": "Identifier",
"start": 16, "start": 16,
@ -31,7 +30,8 @@
} }
}, },
"name": "isFoo" "name": "isFoo"
} },
"modifiers": []
} }
], ],
"children": [] "children": []

@ -15,7 +15,6 @@
"end": 23, "end": 23,
"type": "EventHandler", "type": "EventHandler",
"name": "click", "name": "click",
"modifiers": [],
"expression": { "expression": {
"type": "Identifier", "type": "Identifier",
"start": 19, "start": 19,
@ -31,7 +30,8 @@
} }
}, },
"name": "foo" "name": "foo"
} },
"modifiers": []
} }
], ],
"children": [ "children": [

@ -22,13 +22,13 @@
"end": 46, "end": 46,
"type": "Binding", "type": "Binding",
"name": "foo", "name": "foo",
"modifiers": [],
"expression": { "expression": {
"start": 43, "start": 43,
"end": 46, "end": 46,
"type": "Identifier", "type": "Identifier",
"name": "foo" "name": "foo"
} },
"modifiers": []
} }
], ],
"children": [] "children": []

@ -22,7 +22,6 @@
"end": 55, "end": 55,
"type": "Binding", "type": "Binding",
"name": "value", "name": "value",
"modifiers": [],
"expression": { "expression": {
"type": "Identifier", "type": "Identifier",
"start": 50, "start": 50,
@ -38,7 +37,8 @@
} }
}, },
"name": "name" "name": "name"
} },
"modifiers": []
} }
], ],
"children": [] "children": []

@ -104,7 +104,8 @@
}, },
"value": "svelte", "value": "svelte",
"raw": "'svelte'" "raw": "'svelte'"
} },
"attributes": []
}, },
{ {
"type": "ExpressionStatement", "type": "ExpressionStatement",
@ -257,7 +258,8 @@
}, },
"value": "./foo.js", "value": "./foo.js",
"raw": "'./foo.js'" "raw": "'./foo.js'"
} },
"options": null
}, },
"property": { "property": {
"type": "Identifier", "type": "Identifier",

@ -15,7 +15,6 @@
"end": 45, "end": 45,
"type": "EventHandler", "type": "EventHandler",
"name": "click", "name": "click",
"modifiers": [],
"expression": { "expression": {
"type": "ArrowFunctionExpression", "type": "ArrowFunctionExpression",
"start": 19, "start": 19,
@ -100,7 +99,8 @@
} }
} }
} }
} },
"modifiers": []
} }
], ],
"children": [ "children": [

@ -22,7 +22,6 @@
"end": 692, "end": 692,
"type": "EventHandler", "type": "EventHandler",
"name": "click", "name": "click",
"modifiers": [],
"expression": { "expression": {
"type": "ArrowFunctionExpression", "type": "ArrowFunctionExpression",
"start": 596, "start": 596,
@ -137,7 +136,8 @@
"end": 594 "end": 594
} }
] ]
} },
"modifiers": []
} }
], ],
"children": [ "children": [

@ -22,7 +22,6 @@
"end": 53, "end": 53,
"type": "Binding", "type": "Binding",
"name": "this", "name": "this",
"modifiers": [],
"expression": { "expression": {
"type": "Identifier", "type": "Identifier",
"start": 49, "start": 49,
@ -38,7 +37,8 @@
} }
}, },
"name": "foo" "name": "foo"
} },
"modifiers": []
} }
], ],
"children": [] "children": []

@ -15,8 +15,8 @@
"end": 12, "end": 12,
"type": "Transition", "type": "Transition",
"name": "fade", "name": "fade",
"modifiers": [],
"expression": null, "expression": null,
"modifiers": [],
"intro": true, "intro": true,
"outro": false "outro": false
} }

@ -15,7 +15,6 @@
"end": 30, "end": 30,
"type": "Transition", "type": "Transition",
"name": "style", "name": "style",
"modifiers": [],
"expression": { "expression": {
"type": "ObjectExpression", "type": "ObjectExpression",
"start": 16, "start": 16,
@ -85,6 +84,7 @@
} }
] ]
}, },
"modifiers": [],
"intro": true, "intro": true,
"outro": false "outro": false
} }

Loading…
Cancel
Save