Merge pull request #2225 from sveltejs/gh-2214

Disallow `export ... from` statements
pull/2231/head
Rich Harris 6 years ago committed by GitHub
commit e2a71cfce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
package-lock.json generated

@ -61,9 +61,9 @@
"dev": true
},
"acorn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.5.tgz",
"integrity": "sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg==",
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz",
"integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==",
"dev": true
},
"acorn-dynamic-import": {

@ -51,7 +51,7 @@
"devDependencies": {
"@types/mocha": "^5.2.0",
"@types/node": "^10.5.5",
"acorn": "^6.0.5",
"acorn": "^6.1.1",
"acorn-dynamic-import": "^4.0.0",
"agadoo": "^1.0.1",
"c8": "^3.4.0",

@ -438,6 +438,12 @@ export default class Component {
}
if (node.type === 'ExportNamedDeclaration') {
if (node.source) {
this.error(node, {
code: `not-implemented`,
message: `A component currently cannot have an export ... from`
});
}
if (node.declaration) {
if (node.declaration.type === 'VariableDeclaration') {
node.declaration.declarations.forEach(declarator => {

Loading…
Cancel
Save