Skip to content

Commit

Permalink
Merge pull request #2225 from sveltejs/gh-2214
Browse files Browse the repository at this point in the history
Disallow `export ... from` statements
  • Loading branch information
Rich-Harris authored Mar 15, 2019
2 parents 1fe76d4 + b328cec commit e2a71cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions src/compile/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit e2a71cf

Please sign in to comment.