Check exported bindings are defined (#9589)
* Check exported bindings are defined * Add tests * Update flow whitelist * Add tests for builtins
This commit is contained in:
@@ -49,6 +49,14 @@ export default class StatementParser extends ExpressionParser {
|
||||
|
||||
this.parseBlockBody(program, true, true, tt.eof);
|
||||
|
||||
if (this.inModule && this.scope.undefinedExports.size > 0) {
|
||||
for (const [name] of Array.from(this.scope.undefinedExports)) {
|
||||
const pos = this.scope.undefinedExports.get(name);
|
||||
// $FlowIssue
|
||||
this.raise(pos, `Export '${name}' is not defined`);
|
||||
}
|
||||
}
|
||||
|
||||
file.program = this.finishNode(program, "Program");
|
||||
file.comments = this.state.comments;
|
||||
|
||||
@@ -1631,7 +1639,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
}
|
||||
|
||||
if (isFromRequired || hasSpecifiers || hasDeclaration) {
|
||||
this.checkExport(node, true);
|
||||
this.checkExport(node, true, false, !!node.source);
|
||||
return this.finishNode(node, "ExportNamedDeclaration");
|
||||
}
|
||||
|
||||
@@ -1845,8 +1853,9 @@ export default class StatementParser extends ExpressionParser {
|
||||
|
||||
checkExport(
|
||||
node: N.ExportNamedDeclaration,
|
||||
checkNames: ?boolean,
|
||||
checkNames?: boolean,
|
||||
isDefault?: boolean,
|
||||
isFrom?: boolean,
|
||||
): void {
|
||||
if (checkNames) {
|
||||
// Check for duplicate exports
|
||||
@@ -1857,6 +1866,11 @@ export default class StatementParser extends ExpressionParser {
|
||||
// Named exports
|
||||
for (const specifier of node.specifiers) {
|
||||
this.checkDuplicateExports(specifier, specifier.exported.name);
|
||||
// check if export is defined
|
||||
// $FlowIgnore
|
||||
if (!isFrom && specifier.local) {
|
||||
this.scope.checkLocalExport(specifier.local);
|
||||
}
|
||||
}
|
||||
} else if (node.declaration) {
|
||||
// Exported declarations
|
||||
|
||||
@@ -831,6 +831,7 @@ export type ExportNamedDeclaration = NodeBase & {
|
||||
export type ExportSpecifier = NodeBase & {
|
||||
type: "ExportSpecifier",
|
||||
exported: Identifier,
|
||||
local: Identifier,
|
||||
};
|
||||
|
||||
export type ExportDefaultSpecifier = NodeBase & {
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
type BindingTypes,
|
||||
SCOPE_CLASS,
|
||||
} from "./scopeflags";
|
||||
import * as N from "../types";
|
||||
|
||||
// Start an AST node, attaching a start offset.
|
||||
class Scope {
|
||||
@@ -40,6 +41,7 @@ export default class ScopeHandler {
|
||||
scopeStack: Array<Scope> = [];
|
||||
raise: raiseFunction;
|
||||
inModule: boolean;
|
||||
undefinedExports: Map<string, number> = new Map();
|
||||
|
||||
constructor(raise: raiseFunction, inModule: boolean) {
|
||||
this.raise = raise;
|
||||
@@ -95,6 +97,9 @@ export default class ScopeHandler {
|
||||
scope.functions.indexOf(name) > -1 ||
|
||||
scope.var.indexOf(name) > -1;
|
||||
scope.lexical.push(name);
|
||||
if (this.inModule && scope.flags & SCOPE_PROGRAM) {
|
||||
this.undefinedExports.delete(name);
|
||||
}
|
||||
} else if (bindingType === BIND_SIMPLE_CATCH) {
|
||||
const scope = this.currentScope();
|
||||
scope.lexical.push(name);
|
||||
@@ -122,6 +127,10 @@ export default class ScopeHandler {
|
||||
}
|
||||
scope.var.push(name);
|
||||
|
||||
if (this.inModule && scope.flags & SCOPE_PROGRAM) {
|
||||
this.undefinedExports.delete(name);
|
||||
}
|
||||
|
||||
if (scope.flags & SCOPE_VAR) break;
|
||||
}
|
||||
}
|
||||
@@ -130,6 +139,16 @@ export default class ScopeHandler {
|
||||
}
|
||||
}
|
||||
|
||||
checkLocalExport(id: N.Identifier) {
|
||||
// scope.functions must be empty as Module code is always strict.
|
||||
if (
|
||||
this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
|
||||
this.scopeStack[0].var.indexOf(id.name) === -1
|
||||
) {
|
||||
this.undefinedExports.set(id.name, id.start);
|
||||
}
|
||||
}
|
||||
|
||||
currentScope(): Scope {
|
||||
return this.scopeStack[this.scopeStack.length - 1];
|
||||
}
|
||||
|
||||
1
packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { encrypt as default };
|
||||
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Export 'encrypt' is not defined (1:9)"
|
||||
}
|
||||
2
packages/babel-parser/test/fixtures/core/scope/undecl-export-as/input.js
vendored
Normal file
2
packages/babel-parser/test/fixtures/core/scope/undecl-export-as/input.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { encrypt as decrypt };
|
||||
function decrypt() {}
|
||||
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Export 'encrypt' is not defined (1:9)"
|
||||
}
|
||||
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-block/input.js
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-block/input.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
function encrypt() {}
|
||||
}
|
||||
export { encrypt }
|
||||
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Export 'encrypt' is not defined (4:9)"
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { Object as Obj };
|
||||
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Export 'Object' is not defined (1:9)"
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { Object };
|
||||
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Export 'Object' is not defined (1:9)"
|
||||
}
|
||||
2
packages/babel-parser/test/fixtures/core/scope/undecl-export-if/input.js
vendored
Normal file
2
packages/babel-parser/test/fixtures/core/scope/undecl-export-if/input.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { encrypt };
|
||||
if (true) function encrypt() {}
|
||||
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "In strict mode code, functions can only be declared at top level or inside a block (2:10)"
|
||||
}
|
||||
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-var/input.js
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/scope/undecl-export-var/input.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
var encrypt
|
||||
}
|
||||
export { encrypt }
|
||||
3
packages/babel-parser/test/fixtures/core/scope/undecl-export-var/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/core/scope/undecl-export-var/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"sourceType": "module"
|
||||
}
|
||||
172
packages/babel-parser/test/fixtures/core/scope/undecl-export-var/output.json
vendored
Normal file
172
packages/babel-parser/test/fixtures/core/scope/undecl-export-var/output.json
vendored
Normal file
@@ -0,0 +1,172 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "BlockStatement",
|
||||
"start": 0,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 4,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 8,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 15,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
},
|
||||
"name": "encrypt"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 18,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 27,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 27,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
},
|
||||
"name": "encrypt"
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 27,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 4,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
},
|
||||
"name": "encrypt"
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null,
|
||||
"declaration": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
1
packages/babel-parser/test/fixtures/core/scope/undecl-export/input.js
vendored
Normal file
1
packages/babel-parser/test/fixtures/core/scope/undecl-export/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { encrypt };
|
||||
4
packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json
vendored
Normal file
4
packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sourceType": "module",
|
||||
"throws": "Export 'encrypt' is not defined (1:9)"
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
const toString = 1;
|
||||
|
||||
export { toString };
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
@@ -30,9 +30,9 @@
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -40,36 +40,105 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
"declarations": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 9,
|
||||
"end": 17,
|
||||
"type": "VariableDeclarator",
|
||||
"start": 6,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 6,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
},
|
||||
"identifierName": "toString"
|
||||
},
|
||||
"name": "toString"
|
||||
},
|
||||
"init": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "const"
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 21,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 30,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 17,
|
||||
"start": 30,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 17
|
||||
},
|
||||
"identifierName": "toString"
|
||||
@@ -78,15 +147,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 17,
|
||||
"start": 30,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 17
|
||||
},
|
||||
"identifierName": "toString"
|
||||
@@ -95,7 +164,8 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export { encrypt }
|
||||
export { encrypt }
|
||||
function encrypt () {}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"line": 2,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"line": 2,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
@@ -43,7 +43,6 @@
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
@@ -95,7 +94,60 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
},
|
||||
{
|
||||
"type": "FunctionDeclaration",
|
||||
"start": 19,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 28,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
},
|
||||
"name": "encrypt"
|
||||
},
|
||||
"generator": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 39,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export { encrypt, decrypt }
|
||||
function encrypt () {}
|
||||
class decrypt{}
|
||||
export { encrypt, decrypt }
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 27,
|
||||
"end": 66,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 27,
|
||||
"end": 66,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
@@ -30,9 +30,9 @@
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"type": "FunctionDeclaration",
|
||||
"start": 0,
|
||||
"end": 27,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -40,36 +40,136 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
},
|
||||
"name": "encrypt"
|
||||
},
|
||||
"generator": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 20,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ClassDeclaration",
|
||||
"start": 23,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 29,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"identifierName": "decrypt"
|
||||
},
|
||||
"name": "decrypt"
|
||||
},
|
||||
"superClass": null,
|
||||
"body": {
|
||||
"type": "ClassBody",
|
||||
"start": 36,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 15
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 39,
|
||||
"end": 66,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 9,
|
||||
"end": 16,
|
||||
"start": 48,
|
||||
"end": 55,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 16,
|
||||
"start": 48,
|
||||
"end": 55,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
@@ -78,15 +178,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 16,
|
||||
"start": 48,
|
||||
"end": 55,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
@@ -96,29 +196,29 @@
|
||||
},
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 18,
|
||||
"end": 25,
|
||||
"start": 57,
|
||||
"end": 64,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 25
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 18,
|
||||
"end": 25,
|
||||
"start": 57,
|
||||
"end": 64,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 25
|
||||
},
|
||||
"identifierName": "decrypt"
|
||||
@@ -127,15 +227,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 18,
|
||||
"end": 25,
|
||||
"start": 57,
|
||||
"end": 64,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 25
|
||||
},
|
||||
"identifierName": "decrypt"
|
||||
@@ -144,7 +244,8 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export { encrypt as default }
|
||||
import encrypt from "";
|
||||
export { encrypt as default }
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
@@ -30,9 +30,9 @@
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"type": "ImportDeclaration",
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -40,36 +40,104 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
"column": 23
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 9,
|
||||
"end": 27,
|
||||
"type": "ImportDefaultSpecifier",
|
||||
"start": 7,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 7,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 14
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
},
|
||||
"name": "encrypt"
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": {
|
||||
"type": "StringLiteral",
|
||||
"start": 20,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": "",
|
||||
"raw": "\"\""
|
||||
},
|
||||
"value": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 24,
|
||||
"end": 53,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 33,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 27
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 16,
|
||||
"start": 33,
|
||||
"end": 40,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
@@ -78,15 +146,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 27,
|
||||
"start": 44,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 27
|
||||
},
|
||||
"identifierName": "default"
|
||||
@@ -95,7 +163,8 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export { encrypt, decrypt as dec }
|
||||
function encrypt() {}
|
||||
class decrypt {}
|
||||
export { encrypt, decrypt as dec }
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 34,
|
||||
"end": 73,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 34,
|
||||
"end": 73,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
@@ -30,9 +30,9 @@
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"type": "FunctionDeclaration",
|
||||
"start": 0,
|
||||
"end": 34,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -40,36 +40,136 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
},
|
||||
"name": "encrypt"
|
||||
},
|
||||
"generator": false,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"start": 19,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ClassDeclaration",
|
||||
"start": 22,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 28,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"identifierName": "decrypt"
|
||||
},
|
||||
"name": "decrypt"
|
||||
},
|
||||
"superClass": null,
|
||||
"body": {
|
||||
"type": "ClassBody",
|
||||
"start": 36,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"body": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 39,
|
||||
"end": 73,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 34
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 9,
|
||||
"end": 16,
|
||||
"start": 48,
|
||||
"end": 55,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 16,
|
||||
"start": 48,
|
||||
"end": 55,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
@@ -78,15 +178,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 16,
|
||||
"start": 48,
|
||||
"end": 55,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "encrypt"
|
||||
@@ -96,29 +196,29 @@
|
||||
},
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 18,
|
||||
"end": 32,
|
||||
"start": 57,
|
||||
"end": 71,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 32
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 18,
|
||||
"end": 25,
|
||||
"start": 57,
|
||||
"end": 64,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 25
|
||||
},
|
||||
"identifierName": "decrypt"
|
||||
@@ -127,15 +227,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 29,
|
||||
"end": 32,
|
||||
"start": 68,
|
||||
"end": 71,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 29
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 3,
|
||||
"column": 32
|
||||
},
|
||||
"identifierName": "dec"
|
||||
@@ -144,7 +244,8 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export {foo as default};
|
||||
var foo;
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"end": 33,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
"line": 2,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 24,
|
||||
"end": 33,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 24
|
||||
"line": 2,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
@@ -43,7 +43,6 @@
|
||||
"column": 24
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
@@ -95,7 +94,59 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 25,
|
||||
"end": 33,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 29,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 29,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
var foo, bar;
|
||||
export {foo as bar};
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
@@ -30,9 +30,9 @@
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -40,36 +40,119 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 20
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
"declarations": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 8,
|
||||
"end": 18,
|
||||
"type": "VariableDeclarator",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": null
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 9,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 14,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 22,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"start": 22,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "foo"
|
||||
@@ -78,15 +161,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 15,
|
||||
"end": 18,
|
||||
"start": 29,
|
||||
"end": 32,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 15
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 18
|
||||
},
|
||||
"identifierName": "bar"
|
||||
@@ -95,7 +178,8 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export {foo as default, bar};
|
||||
var foo, bar;
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"end": 43,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"end": 43,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 29
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
@@ -43,7 +43,6 @@
|
||||
"column": 29
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
@@ -144,7 +143,92 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 30,
|
||||
"end": 43,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 34,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 34,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": null
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 39,
|
||||
"end": 42,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 39,
|
||||
"end": 42,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
let foo;
|
||||
export {foo};
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 13,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 13,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
@@ -30,9 +30,9 @@
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 13,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -40,36 +40,86 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
"declarations": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"type": "VariableDeclarator",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "let"
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 9,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "foo"
|
||||
@@ -78,15 +128,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "foo"
|
||||
@@ -95,7 +145,8 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
var bar;
|
||||
export {foo, bar,};
|
||||
var foo;
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
"line": 3,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
"line": 3,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 19,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -40,36 +40,86 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 19
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
"declarations": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"type": "VariableDeclarator",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 9,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 19
|
||||
}
|
||||
},
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "foo"
|
||||
@@ -78,15 +128,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "foo"
|
||||
@@ -96,29 +146,29 @@
|
||||
},
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"start": 22,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"start": 22,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "bar"
|
||||
@@ -127,15 +177,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"start": 22,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "bar"
|
||||
@@ -144,7 +194,59 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 29,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 33,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 33,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
var foo;
|
||||
export {foo, bar};
|
||||
var bar;
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"line": 3,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"line": 3,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -40,36 +40,86 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
"declarations": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"type": "VariableDeclarator",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 9,
|
||||
"end": 27,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 11
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "foo"
|
||||
@@ -78,15 +128,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"start": 17,
|
||||
"end": 20,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"identifierName": "foo"
|
||||
@@ -96,29 +146,29 @@
|
||||
},
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"start": 22,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"start": 22,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "bar"
|
||||
@@ -127,15 +177,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"start": 22,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "bar"
|
||||
@@ -144,7 +194,59 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"source": null
|
||||
"source": null,
|
||||
"declaration": null
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 28,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 32,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 32,
|
||||
"end": 35,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "bar"
|
||||
},
|
||||
"name": "bar"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
declare module "foo" { declare export {a,}; }
|
||||
var a;
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 45,
|
||||
"end": 52,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 45
|
||||
"line": 2,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 45,
|
||||
"end": 52,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 45
|
||||
"line": 2,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
@@ -92,7 +92,6 @@
|
||||
"column": 43
|
||||
}
|
||||
},
|
||||
"declaration": null,
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
@@ -145,11 +144,63 @@
|
||||
}
|
||||
],
|
||||
"source": null,
|
||||
"declaration": null,
|
||||
"default": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"kind": "ES"
|
||||
},
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 46,
|
||||
"end": 52,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 50,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 50,
|
||||
"end": 51,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
let foo;
|
||||
export type { foo };
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
@@ -30,9 +30,9 @@
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 20,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
@@ -40,35 +40,86 @@
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 4,
|
||||
"end": 7,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "foo"
|
||||
},
|
||||
"name": "foo"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "let"
|
||||
},
|
||||
{
|
||||
"type": "ExportNamedDeclaration",
|
||||
"start": 9,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"specifiers": [
|
||||
{
|
||||
"type": "ExportSpecifier",
|
||||
"start": 14,
|
||||
"end": 17,
|
||||
"start": 23,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"local": {
|
||||
"type": "Identifier",
|
||||
"start": 14,
|
||||
"end": 17,
|
||||
"start": 23,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 17
|
||||
},
|
||||
"identifierName": "foo"
|
||||
@@ -77,15 +128,15 @@
|
||||
},
|
||||
"exported": {
|
||||
"type": "Identifier",
|
||||
"start": 14,
|
||||
"end": 17,
|
||||
"start": 23,
|
||||
"end": 26,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"line": 2,
|
||||
"column": 17
|
||||
},
|
||||
"identifierName": "foo"
|
||||
|
||||
Reference in New Issue
Block a user