rollup 0.55.1 → 0.55.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +40 -4
- package/bin/rollup +13 -4
- package/dist/rollup.browser.js +134 -79
- package/dist/rollup.es.js +135 -80
- package/dist/rollup.js +136 -81
- package/dist/typings/Chunk.d.ts +4 -0
- package/dist/typings/Graph.d.ts +1 -2
- package/dist/typings/rollup/index.d.ts +1 -0
- package/dist/typings/utils/defaults.d.ts +2 -1
- package/dist/typings/utils/renderHelpers.d.ts +12 -0
- package/dist/typings/watch/index.d.ts +1 -1
- package/package.json +10 -5
- package/dist/typings/Bundle.d.ts +0 -29
- package/dist/typings/ast/Node.d.ts +0 -185
- package/dist/typings/ast/nodes/Declaration.d.ts +0 -8
- package/dist/typings/ast/nodes/Expression.d.ts +0 -46
- package/dist/typings/ast/nodes/Pattern.d.ts +0 -12
- package/dist/typings/ast/nodes/Statement.d.ts +0 -10
- package/dist/typings/ast/nodes/shared/VirtualObjectExpression.d.ts +0 -7
- package/dist/typings/ast/nodes/shared/disallowIllegalReassignment.d.ts +0 -6
- package/dist/typings/bin/src/index.d.ts +0 -1
- package/dist/typings/bin/src/logging.d.ts +0 -3
- package/dist/typings/bin/src/run/alternateScreen.d.ts +0 -8
- package/dist/typings/bin/src/run/batchWarnings.d.ts +0 -11
- package/dist/typings/bin/src/run/build.d.ts +0 -9
- package/dist/typings/bin/src/run/index.d.ts +0 -1
- package/dist/typings/bin/src/run/loadConfigFile.d.ts +0 -6
- package/dist/typings/bin/src/run/watch.d.ts +0 -8
- package/dist/typings/bin/src/sourceMappingUrl.d.ts +0 -2
- package/dist/typings/bin/src/utils/sequence.d.ts +0 -4
- package/dist/typings/browser/fs.d.ts +0 -5
- package/dist/typings/browser/path.d.ts +0 -10
- package/dist/typings/src/Bundle.d.ts +0 -29
- package/dist/typings/src/ExternalModule.d.ts +0 -23
- package/dist/typings/src/Graph.d.ts +0 -60
- package/dist/typings/src/Module.d.ts +0 -137
- package/dist/typings/src/ast/CallOptions.d.ts +0 -24
- package/dist/typings/src/ast/Entity.d.ts +0 -19
- package/dist/typings/src/ast/ExecutionPathOptions.d.ts +0 -97
- package/dist/typings/src/ast/Node.d.ts +0 -186
- package/dist/typings/src/ast/clone.d.ts +0 -1
- package/dist/typings/src/ast/comment.d.ts +0 -4
- package/dist/typings/src/ast/enhance.d.ts +0 -7
- package/dist/typings/src/ast/keys.d.ts +0 -4
- package/dist/typings/src/ast/nodes/ArrayExpression.d.ts +0 -9
- package/dist/typings/src/ast/nodes/ArrayPattern.d.ts +0 -21
- package/dist/typings/src/ast/nodes/ArrowFunctionExpression.d.ts +0 -48
- package/dist/typings/src/ast/nodes/AssignmentExpression.d.ts +0 -16
- package/dist/typings/src/ast/nodes/AssignmentPattern.d.ts +0 -23
- package/dist/typings/src/ast/nodes/AssignmentProperty.d.ts +0 -10
- package/dist/typings/src/ast/nodes/AwaitExpression.d.ts +0 -8
- package/dist/typings/src/ast/nodes/BinaryExpression.d.ts +0 -38
- package/dist/typings/src/ast/nodes/BlockStatement.d.ts +0 -19
- package/dist/typings/src/ast/nodes/BreakStatement.d.ts +0 -9
- package/dist/typings/src/ast/nodes/CallExpression.d.ts +0 -45
- package/dist/typings/src/ast/nodes/CatchClause.d.ts +0 -14
- package/dist/typings/src/ast/nodes/ClassBody.d.ts +0 -17
- package/dist/typings/src/ast/nodes/ClassDeclaration.d.ts +0 -11
- package/dist/typings/src/ast/nodes/ClassExpression.d.ts +0 -10
- package/dist/typings/src/ast/nodes/ConditionalExpression.d.ts +0 -50
- package/dist/typings/src/ast/nodes/Declaration.d.ts +0 -8
- package/dist/typings/src/ast/nodes/DoWhileStatement.d.ts +0 -10
- package/dist/typings/src/ast/nodes/EmptyStatement.d.ts +0 -7
- package/dist/typings/src/ast/nodes/ExportAllDeclaration.d.ts +0 -11
- package/dist/typings/src/ast/nodes/ExportDefaultDeclaration.d.ts +0 -18
- package/dist/typings/src/ast/nodes/ExportNamedDeclaration.d.ts +0 -24
- package/dist/typings/src/ast/nodes/ExportSpecifier.d.ts +0 -8
- package/dist/typings/src/ast/nodes/Expression.d.ts +0 -46
- package/dist/typings/src/ast/nodes/ExpressionStatement.d.ts +0 -5
- package/dist/typings/src/ast/nodes/ForInStatement.d.ts +0 -17
- package/dist/typings/src/ast/nodes/ForOfStatement.d.ts +0 -18
- package/dist/typings/src/ast/nodes/ForStatement.d.ts +0 -16
- package/dist/typings/src/ast/nodes/FunctionDeclaration.d.ts +0 -9
- package/dist/typings/src/ast/nodes/FunctionExpression.d.ts +0 -6
- package/dist/typings/src/ast/nodes/Identifier.d.ts +0 -56
- package/dist/typings/src/ast/nodes/IfStatement.d.ts +0 -15
- package/dist/typings/src/ast/nodes/Import.d.ts +0 -20
- package/dist/typings/src/ast/nodes/ImportDeclaration.d.ts +0 -19
- package/dist/typings/src/ast/nodes/ImportDefaultSpecifier.d.ts +0 -7
- package/dist/typings/src/ast/nodes/ImportNamespaceSpecifier.d.ts +0 -7
- package/dist/typings/src/ast/nodes/ImportSpecifier.d.ts +0 -8
- package/dist/typings/src/ast/nodes/LabeledStatement.d.ts +0 -10
- package/dist/typings/src/ast/nodes/Literal.d.ts +0 -22
- package/dist/typings/src/ast/nodes/LogicalExpression.d.ts +0 -47
- package/dist/typings/src/ast/nodes/MemberExpression.d.ts +0 -61
- package/dist/typings/src/ast/nodes/MethodDefinition.d.ts +0 -20
- package/dist/typings/src/ast/nodes/NewExpression.d.ts +0 -17
- package/dist/typings/src/ast/nodes/ObjectExpression.d.ts +0 -52
- package/dist/typings/src/ast/nodes/ObjectPattern.d.ts +0 -22
- package/dist/typings/src/ast/nodes/Pattern.d.ts +0 -12
- package/dist/typings/src/ast/nodes/Program.d.ts +0 -7
- package/dist/typings/src/ast/nodes/Property.d.ts +0 -57
- package/dist/typings/src/ast/nodes/RestElement.d.ts +0 -21
- package/dist/typings/src/ast/nodes/ReturnStatement.d.ts +0 -10
- package/dist/typings/src/ast/nodes/SequenceExpression.d.ts +0 -12
- package/dist/typings/src/ast/nodes/SpreadElement.d.ts +0 -6
- package/dist/typings/src/ast/nodes/Statement.d.ts +0 -10
- package/dist/typings/src/ast/nodes/SwitchCase.d.ts +0 -9
- package/dist/typings/src/ast/nodes/SwitchStatement.d.ts +0 -13
- package/dist/typings/src/ast/nodes/TaggedTemplateExpression.d.ts +0 -13
- package/dist/typings/src/ast/nodes/TemplateElement.d.ts +0 -12
- package/dist/typings/src/ast/nodes/TemplateLiteral.d.ts +0 -10
- package/dist/typings/src/ast/nodes/ThisExpression.d.ts +0 -22
- package/dist/typings/src/ast/nodes/ThrowStatement.d.ts +0 -9
- package/dist/typings/src/ast/nodes/UnaryExpression.d.ts +0 -19
- package/dist/typings/src/ast/nodes/UnknownNode.d.ts +0 -5
- package/dist/typings/src/ast/nodes/UpdateExpression.d.ts +0 -16
- package/dist/typings/src/ast/nodes/VariableDeclaration.d.ts +0 -23
- package/dist/typings/src/ast/nodes/VariableDeclarator.d.ts +0 -15
- package/dist/typings/src/ast/nodes/WhileStatement.d.ts +0 -10
- package/dist/typings/src/ast/nodes/YieldExpression.d.ts +0 -9
- package/dist/typings/src/ast/nodes/index.d.ts +0 -69
- package/dist/typings/src/ast/nodes/shared/ClassNode.d.ts +0 -27
- package/dist/typings/src/ast/nodes/shared/Expression.d.ts +0 -42
- package/dist/typings/src/ast/nodes/shared/FunctionNode.d.ts +0 -42
- package/dist/typings/src/ast/nodes/shared/Node.d.ts +0 -169
- package/dist/typings/src/ast/nodes/shared/Pattern.d.ts +0 -3
- package/dist/typings/src/ast/nodes/shared/Statement.d.ts +0 -6
- package/dist/typings/src/ast/nodes/shared/VirtualObjectExpression.d.ts +0 -7
- package/dist/typings/src/ast/nodes/shared/disallowIllegalReassignment.d.ts +0 -6
- package/dist/typings/src/ast/nodes/shared/pureFunctions.d.ts +0 -4
- package/dist/typings/src/ast/scopes/BlockScope.d.ts +0 -12
- package/dist/typings/src/ast/scopes/CatchScope.d.ts +0 -13
- package/dist/typings/src/ast/scopes/FunctionScope.d.ts +0 -27
- package/dist/typings/src/ast/scopes/GlobalScope.d.ts +0 -6
- package/dist/typings/src/ast/scopes/ModuleScope.d.ts +0 -11
- package/dist/typings/src/ast/scopes/ParameterScope.d.ts +0 -16
- package/dist/typings/src/ast/scopes/ReturnValueScope.d.ts +0 -24
- package/dist/typings/src/ast/scopes/Scope.d.ts +0 -49
- package/dist/typings/src/ast/utils/extractNames.d.ts +0 -2
- package/dist/typings/src/ast/values.d.ts +0 -5
- package/dist/typings/src/ast/variables/ArgumentsVariable.d.ts +0 -30
- package/dist/typings/src/ast/variables/ExportDefaultVariable.d.ts +0 -19
- package/dist/typings/src/ast/variables/ExternalVariable.d.ts +0 -17
- package/dist/typings/src/ast/variables/GlobalVariable.d.ts +0 -12
- package/dist/typings/src/ast/variables/LocalVariable.d.ts +0 -51
- package/dist/typings/src/ast/variables/NamespaceVariable.d.ts +0 -23
- package/dist/typings/src/ast/variables/ParameterVariable.d.ts +0 -6
- package/dist/typings/src/ast/variables/ReplaceableInitializationVariable.d.ts +0 -33
- package/dist/typings/src/ast/variables/ThisVariable.d.ts +0 -4
- package/dist/typings/src/ast/variables/Variable.d.ts +0 -63
- package/dist/typings/src/ast/variables/VariableReassignmentTracker.d.ts +0 -25
- package/dist/typings/src/banner.d.ts +0 -0
- package/dist/typings/src/browser-entry.d.ts +0 -2
- package/dist/typings/src/finalisers/amd.d.ts +0 -21
- package/dist/typings/src/finalisers/cjs.d.ts +0 -20
- package/dist/typings/src/finalisers/es.d.ts +0 -17
- package/dist/typings/src/finalisers/iife.d.ts +0 -20
- package/dist/typings/src/finalisers/index.d.ts +0 -25
- package/dist/typings/src/finalisers/shared/esModuleExport.d.ts +0 -2
- package/dist/typings/src/finalisers/shared/getExportBlock.d.ts +0 -6
- package/dist/typings/src/finalisers/shared/getGlobalNameMaker.d.ts +0 -9
- package/dist/typings/src/finalisers/shared/getInteropBlock.d.ts +0 -6
- package/dist/typings/src/finalisers/shared/sanitize.d.ts +0 -2
- package/dist/typings/src/finalisers/shared/setupNamespace.d.ts +0 -7
- package/dist/typings/src/finalisers/shared/trimEmptyImports.d.ts +0 -5
- package/dist/typings/src/finalisers/shared/warnOnBuiltins.d.ts +0 -2
- package/dist/typings/src/finalisers/umd.d.ts +0 -21
- package/dist/typings/src/node-entry.d.ts +0 -5
- package/dist/typings/src/rollup/index.d.ts +0 -172
- package/dist/typings/src/utils/array.d.ts +0 -4
- package/dist/typings/src/utils/callIfFunction.d.ts +0 -1
- package/dist/typings/src/utils/collapseSourcemaps.d.ts +0 -11
- package/dist/typings/src/utils/defaults.d.ts +0 -6
- package/dist/typings/src/utils/deprecateOptions.d.ts +0 -9
- package/dist/typings/src/utils/dynamic-import-plugin.d.ts +0 -8
- package/dist/typings/src/utils/ensureArray.d.ts +0 -2
- package/dist/typings/src/utils/error.d.ts +0 -18
- package/dist/typings/src/utils/first.d.ts +0 -3
- package/dist/typings/src/utils/flushTime.d.ts +0 -5
- package/dist/typings/src/utils/fs.d.ts +0 -6
- package/dist/typings/src/utils/getCodeFrame.d.ts +0 -5
- package/dist/typings/src/utils/getExportMode.d.ts +0 -6
- package/dist/typings/src/utils/getIndentString.d.ts +0 -7
- package/dist/typings/src/utils/identifierHelpers.d.ts +0 -3
- package/dist/typings/src/utils/mergeOptions.d.ts +0 -21
- package/dist/typings/src/utils/object.d.ts +0 -9
- package/dist/typings/src/utils/path.d.ts +0 -6
- package/dist/typings/src/utils/promise.d.ts +0 -5
- package/dist/typings/src/utils/relativeId.d.ts +0 -1
- package/dist/typings/src/utils/sourceMappingURL.d.ts +0 -3
- package/dist/typings/src/utils/transform.d.ts +0 -16
- package/dist/typings/src/utils/transformBundle.d.ts +0 -8
- package/dist/typings/src/watch/chokidar.d.ts +0 -4
- package/dist/typings/src/watch/fileWatchers.d.ts +0 -23
- package/dist/typings/src/watch/index.d.ts +0 -48
- package/dist/typings/utils/array.d.ts +0 -4
- package/dist/typings/utils/dynamic-import-plugin.d.ts +0 -13
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { NodeBase, Node, ExpressionNode } from "./shared/Node";
|
|
2
|
-
import CallOptions from "../CallOptions";
|
|
3
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
4
|
-
import Scope from "../scopes/Scope";
|
|
5
|
-
import MagicString from "magic-string";
|
|
6
|
-
import { ObjectPath } from "../variables/VariableReassignmentTracker";
|
|
7
|
-
import {
|
|
8
|
-
ExpressionEntity,
|
|
9
|
-
ForEachReturnExpressionCallback,
|
|
10
|
-
SomeReturnExpressionCallback
|
|
11
|
-
} from "./shared/Expression";
|
|
12
|
-
import { NodeType } from "./index";
|
|
13
|
-
export declare function isProperty(node: Node): node is Property;
|
|
14
|
-
export default class Property extends NodeBase {
|
|
15
|
-
type: NodeType.Property;
|
|
16
|
-
key: ExpressionNode;
|
|
17
|
-
value: ExpressionNode;
|
|
18
|
-
kind: "init" | "get" | "set";
|
|
19
|
-
method: boolean;
|
|
20
|
-
shorthand: boolean;
|
|
21
|
-
computed: boolean;
|
|
22
|
-
private _accessorCallOptions;
|
|
23
|
-
reassignPath(path: ObjectPath, options: ExecutionPathOptions): void;
|
|
24
|
-
forEachReturnExpressionWhenCalledAtPath(
|
|
25
|
-
path: ObjectPath,
|
|
26
|
-
callOptions: CallOptions,
|
|
27
|
-
callback: ForEachReturnExpressionCallback,
|
|
28
|
-
options: ExecutionPathOptions
|
|
29
|
-
): void;
|
|
30
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
31
|
-
hasEffectsWhenAccessedAtPath(
|
|
32
|
-
path: ObjectPath,
|
|
33
|
-
options: ExecutionPathOptions
|
|
34
|
-
): boolean;
|
|
35
|
-
hasEffectsWhenAssignedAtPath(
|
|
36
|
-
path: ObjectPath,
|
|
37
|
-
options: ExecutionPathOptions
|
|
38
|
-
): boolean;
|
|
39
|
-
hasEffectsWhenCalledAtPath(
|
|
40
|
-
path: ObjectPath,
|
|
41
|
-
callOptions: CallOptions,
|
|
42
|
-
options: ExecutionPathOptions
|
|
43
|
-
): boolean;
|
|
44
|
-
initialiseAndDeclare(
|
|
45
|
-
parentScope: Scope,
|
|
46
|
-
kind: string,
|
|
47
|
-
_init: ExpressionEntity | null
|
|
48
|
-
): void;
|
|
49
|
-
initialiseNode(_parentScope: Scope): void;
|
|
50
|
-
render(code: MagicString, es: boolean): void;
|
|
51
|
-
someReturnExpressionWhenCalledAtPath(
|
|
52
|
-
path: ObjectPath,
|
|
53
|
-
callOptions: CallOptions,
|
|
54
|
-
predicateFunction: SomeReturnExpressionCallback,
|
|
55
|
-
options: ExecutionPathOptions
|
|
56
|
-
): boolean;
|
|
57
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
2
|
-
import Scope from "../scopes/Scope";
|
|
3
|
-
import { ObjectPath } from "../variables/VariableReassignmentTracker";
|
|
4
|
-
import { PatternNode } from "./shared/Pattern";
|
|
5
|
-
import { ExpressionEntity } from "./shared/Expression";
|
|
6
|
-
import { NodeBase } from "./shared/Node";
|
|
7
|
-
import { NodeType } from "./index";
|
|
8
|
-
export default class RestElement extends NodeBase implements PatternNode {
|
|
9
|
-
type: NodeType.RestElement;
|
|
10
|
-
argument: PatternNode;
|
|
11
|
-
reassignPath(path: ObjectPath, options: ExecutionPathOptions): void;
|
|
12
|
-
hasEffectsWhenAssignedAtPath(
|
|
13
|
-
path: ObjectPath,
|
|
14
|
-
options: ExecutionPathOptions
|
|
15
|
-
): boolean;
|
|
16
|
-
initialiseAndDeclare(
|
|
17
|
-
parentScope: Scope,
|
|
18
|
-
kind: string,
|
|
19
|
-
_init: ExpressionEntity | null
|
|
20
|
-
): void;
|
|
21
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
2
|
-
import { StatementBase } from "./shared/Statement";
|
|
3
|
-
import { NodeType } from "./index";
|
|
4
|
-
import { ExpressionNode } from "./shared/Node";
|
|
5
|
-
export default class ReturnStatement extends StatementBase {
|
|
6
|
-
type: NodeType.ReturnStatement;
|
|
7
|
-
argument: ExpressionNode | null;
|
|
8
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
9
|
-
initialiseNode(): void;
|
|
10
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
2
|
-
import MagicString from "magic-string";
|
|
3
|
-
import { ExpressionNode, NodeBase } from "./shared/Node";
|
|
4
|
-
import { NodeType } from "./index";
|
|
5
|
-
export default class SequenceExpression extends NodeBase {
|
|
6
|
-
type: NodeType.SequenceExpression;
|
|
7
|
-
expressions: ExpressionNode[];
|
|
8
|
-
getValue(): any;
|
|
9
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
10
|
-
includeInBundle(): boolean;
|
|
11
|
-
render(code: MagicString, es: boolean): void;
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { default as StatementBaseClass } from "./shared/Statement";
|
|
2
|
-
import FunctionDeclaration from "./FunctionDeclaration";
|
|
3
|
-
import VariableDeclaration from "./VariableDeclaration";
|
|
4
|
-
import ClassDeclaration from "./ClassDeclaration";
|
|
5
|
-
declare type Statement =
|
|
6
|
-
| FunctionDeclaration
|
|
7
|
-
| VariableDeclaration
|
|
8
|
-
| ClassDeclaration
|
|
9
|
-
| StatementBaseClass;
|
|
10
|
-
export default Statement;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ExpressionNode, NodeBase } from "./shared/Node";
|
|
2
|
-
import { StatementNode } from "./shared/Statement";
|
|
3
|
-
import { NodeType } from "./index";
|
|
4
|
-
export default class SwitchCase extends NodeBase {
|
|
5
|
-
type: NodeType.SwitchCase;
|
|
6
|
-
test: ExpressionNode | null;
|
|
7
|
-
consequent: StatementNode[];
|
|
8
|
-
includeInBundle(): boolean;
|
|
9
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import SwitchCase from "./SwitchCase";
|
|
2
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
3
|
-
import Scope from "../scopes/Scope";
|
|
4
|
-
import { StatementBase } from "./shared/Statement";
|
|
5
|
-
import { NodeType } from "./index";
|
|
6
|
-
import { ExpressionNode } from "./shared/Node";
|
|
7
|
-
export default class SwitchStatement extends StatementBase {
|
|
8
|
-
type: NodeType.SwitchStatement;
|
|
9
|
-
discriminant: ExpressionNode;
|
|
10
|
-
cases: SwitchCase[];
|
|
11
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
12
|
-
initialiseScope(parentScope: Scope): void;
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import TemplateLiteral from "./TemplateLiteral";
|
|
2
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
3
|
-
import { NodeType } from "./index";
|
|
4
|
-
import { ExpressionNode, NodeBase } from "./shared/Node";
|
|
5
|
-
export default class TaggedTemplateExpression extends NodeBase {
|
|
6
|
-
type: NodeType.TaggedTemplateExpression;
|
|
7
|
-
tag: ExpressionNode;
|
|
8
|
-
quasi: TemplateLiteral;
|
|
9
|
-
private _callOptions;
|
|
10
|
-
bindNode(): void;
|
|
11
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
12
|
-
initialiseNode(): void;
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NodeBase } from "./shared/Node";
|
|
2
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
3
|
-
import { NodeType } from "./index";
|
|
4
|
-
export default class TemplateElement extends NodeBase {
|
|
5
|
-
type: NodeType.TemplateElement;
|
|
6
|
-
tail: boolean;
|
|
7
|
-
value: {
|
|
8
|
-
cooked: string;
|
|
9
|
-
raw: string;
|
|
10
|
-
};
|
|
11
|
-
hasEffects(_options: ExecutionPathOptions): boolean;
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import TemplateElement from "./TemplateElement";
|
|
2
|
-
import MagicString from "magic-string";
|
|
3
|
-
import { ExpressionNode, NodeBase } from "./shared/Node";
|
|
4
|
-
import { NodeType } from "./index";
|
|
5
|
-
export default class TemplateLiteral extends NodeBase {
|
|
6
|
-
type: NodeType.TemplateLiteral;
|
|
7
|
-
quasis: TemplateElement[];
|
|
8
|
-
expressions: ExpressionNode[];
|
|
9
|
-
render(code: MagicString, es: boolean): void;
|
|
10
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import ThisVariable from "../variables/ThisVariable";
|
|
2
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
3
|
-
import MagicString from "magic-string";
|
|
4
|
-
import { ObjectPath } from "../variables/VariableReassignmentTracker";
|
|
5
|
-
import { NodeBase } from "./shared/Node";
|
|
6
|
-
import { NodeType } from "./index";
|
|
7
|
-
export default class ThisExpression extends NodeBase {
|
|
8
|
-
type: NodeType.ThisExpression;
|
|
9
|
-
variable: ThisVariable;
|
|
10
|
-
alias: string;
|
|
11
|
-
initialiseNode(): void;
|
|
12
|
-
bindNode(): void;
|
|
13
|
-
hasEffectsWhenAccessedAtPath(
|
|
14
|
-
path: ObjectPath,
|
|
15
|
-
options: ExecutionPathOptions
|
|
16
|
-
): boolean;
|
|
17
|
-
hasEffectsWhenAssignedAtPath(
|
|
18
|
-
path: ObjectPath,
|
|
19
|
-
options: ExecutionPathOptions
|
|
20
|
-
): boolean;
|
|
21
|
-
render(code: MagicString, _es: boolean): void;
|
|
22
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
2
|
-
import { StatementBase } from "./shared/Statement";
|
|
3
|
-
import { NodeType } from "./index";
|
|
4
|
-
import { ExpressionNode } from "./shared/Node";
|
|
5
|
-
export default class ThrowStatement extends StatementBase {
|
|
6
|
-
type: NodeType.ThrowStatement;
|
|
7
|
-
argument: ExpressionNode;
|
|
8
|
-
hasEffects(_options: ExecutionPathOptions): boolean;
|
|
9
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
2
|
-
import { ObjectPath } from "../variables/VariableReassignmentTracker";
|
|
3
|
-
import { NodeType } from "./index";
|
|
4
|
-
import { ExpressionNode, NodeBase } from "./shared/Node";
|
|
5
|
-
export default class UnaryExpression extends NodeBase {
|
|
6
|
-
type: NodeType.UnaryExpression;
|
|
7
|
-
operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
|
|
8
|
-
prefix: boolean;
|
|
9
|
-
argument: ExpressionNode;
|
|
10
|
-
value: any;
|
|
11
|
-
bindNode(): void;
|
|
12
|
-
getValue(): any;
|
|
13
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
14
|
-
hasEffectsWhenAccessedAtPath(
|
|
15
|
-
path: ObjectPath,
|
|
16
|
-
_options: ExecutionPathOptions
|
|
17
|
-
): boolean;
|
|
18
|
-
initialiseNode(): void;
|
|
19
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
2
|
-
import { ObjectPath } from "../variables/VariableReassignmentTracker";
|
|
3
|
-
import { NodeType } from "./index";
|
|
4
|
-
import { ExpressionNode, NodeBase } from "./shared/Node";
|
|
5
|
-
export default class UpdateExpression extends NodeBase {
|
|
6
|
-
type: NodeType.UpdateExpression;
|
|
7
|
-
operator: "++" | "--" | "**";
|
|
8
|
-
argument: ExpressionNode;
|
|
9
|
-
prefix: boolean;
|
|
10
|
-
bindNode(): void;
|
|
11
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
12
|
-
hasEffectsWhenAccessedAtPath(
|
|
13
|
-
path: ObjectPath,
|
|
14
|
-
_options: ExecutionPathOptions
|
|
15
|
-
): boolean;
|
|
16
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Node, NodeBase } from "./shared/Node";
|
|
2
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
3
|
-
import VariableDeclarator from "./VariableDeclarator";
|
|
4
|
-
import MagicString from "magic-string";
|
|
5
|
-
import { ObjectPath } from "../variables/VariableReassignmentTracker";
|
|
6
|
-
import { NodeType } from "./index";
|
|
7
|
-
export declare function isVariableDeclaration(
|
|
8
|
-
node: Node
|
|
9
|
-
): node is VariableDeclaration;
|
|
10
|
-
export default class VariableDeclaration extends NodeBase {
|
|
11
|
-
type: NodeType.VariableDeclaration;
|
|
12
|
-
declarations: VariableDeclarator[];
|
|
13
|
-
kind: "var" | "let" | "const";
|
|
14
|
-
reassignPath(_path: ObjectPath, _options: ExecutionPathOptions): void;
|
|
15
|
-
hasEffectsWhenAssignedAtPath(
|
|
16
|
-
_path: ObjectPath,
|
|
17
|
-
_options: ExecutionPathOptions
|
|
18
|
-
): boolean;
|
|
19
|
-
includeWithAllDeclarations(): boolean;
|
|
20
|
-
includeInBundle(): boolean;
|
|
21
|
-
initialiseChildren(): void;
|
|
22
|
-
render(code: MagicString, es: boolean): void;
|
|
23
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ExpressionNode, NodeBase } from "./shared/Node";
|
|
2
|
-
import Scope from "../scopes/Scope";
|
|
3
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
4
|
-
import MagicString from "magic-string";
|
|
5
|
-
import { ObjectPath } from "../variables/VariableReassignmentTracker";
|
|
6
|
-
import { PatternNode } from "./shared/Pattern";
|
|
7
|
-
import { NodeType } from "./index";
|
|
8
|
-
export default class VariableDeclarator extends NodeBase {
|
|
9
|
-
type: NodeType.VariableDeclarator;
|
|
10
|
-
id: PatternNode;
|
|
11
|
-
init: ExpressionNode | null;
|
|
12
|
-
reassignPath(path: ObjectPath, options: ExecutionPathOptions): void;
|
|
13
|
-
initialiseDeclarator(parentScope: Scope, kind: string): void;
|
|
14
|
-
render(code: MagicString, es: boolean): void;
|
|
15
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
2
|
-
import { StatementBase, StatementNode } from "./shared/Statement";
|
|
3
|
-
import { NodeType } from "./index";
|
|
4
|
-
import { ExpressionNode } from "./shared/Node";
|
|
5
|
-
export default class WhileStatement extends StatementBase {
|
|
6
|
-
type: NodeType.WhileStatement;
|
|
7
|
-
test: ExpressionNode;
|
|
8
|
-
body: StatementNode;
|
|
9
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
10
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import ExecutionPathOptions from "../ExecutionPathOptions";
|
|
2
|
-
import { NodeType } from "./index";
|
|
3
|
-
import { ExpressionNode, NodeBase } from "./shared/Node";
|
|
4
|
-
export default class YieldExpression extends NodeBase {
|
|
5
|
-
type: NodeType.YieldExpression;
|
|
6
|
-
argument: ExpressionNode | null;
|
|
7
|
-
delegate: boolean;
|
|
8
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
9
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { NodeBase } from "./shared/Node";
|
|
2
|
-
export const enum NodeType {
|
|
3
|
-
ArrayExpression = "ArrayExpression",
|
|
4
|
-
ArrayPattern = "ArrayPattern",
|
|
5
|
-
ArrowFunctionExpression = "ArrowFunctionExpression",
|
|
6
|
-
AssignmentExpression = "AssignmentExpression",
|
|
7
|
-
AssignmentPattern = "AssignmentPattern",
|
|
8
|
-
AwaitExpression = "AwaitExpression",
|
|
9
|
-
BinaryExpression = "BinaryExpression",
|
|
10
|
-
BlockStatement = "BlockStatement",
|
|
11
|
-
BreakStatement = "BreakStatement",
|
|
12
|
-
CallExpression = "CallExpression",
|
|
13
|
-
CatchClause = "CatchClause",
|
|
14
|
-
ClassBody = "ClassBody",
|
|
15
|
-
ClassDeclaration = "ClassDeclaration",
|
|
16
|
-
ClassExpression = "ClassExpression",
|
|
17
|
-
ConditionalExpression = "ConditionalExpression",
|
|
18
|
-
DoWhileStatement = "DoWhileStatement",
|
|
19
|
-
EmptyStatement = "EmptyStatement",
|
|
20
|
-
ExportAllDeclaration = "ExportAllDeclaration",
|
|
21
|
-
ExportDefaultDeclaration = "ExportDefaultDeclaration",
|
|
22
|
-
ExportNamedDeclaration = "ExportNamedDeclaration",
|
|
23
|
-
ExportSpecifier = "ExportSpecifier",
|
|
24
|
-
ExpressionStatement = "ExpressionStatement",
|
|
25
|
-
ForStatement = "ForStatement",
|
|
26
|
-
ForInStatement = "ForInStatement",
|
|
27
|
-
ForOfStatement = "ForOfStatement",
|
|
28
|
-
FunctionDeclaration = "FunctionDeclaration",
|
|
29
|
-
FunctionExpression = "FunctionExpression",
|
|
30
|
-
Identifier = "Identifier",
|
|
31
|
-
IfStatement = "IfStatement",
|
|
32
|
-
Import = "Import",
|
|
33
|
-
ImportDeclaration = "ImportDeclaration",
|
|
34
|
-
ImportDefaultSpecifier = "ImportDefaultSpecifier",
|
|
35
|
-
ImportNamespaceSpecifier = "ImportNamespaceSpecifier",
|
|
36
|
-
ImportSpecifier = "ImportSpecifier",
|
|
37
|
-
LabeledStatement = "LabeledStatement",
|
|
38
|
-
Literal = "Literal",
|
|
39
|
-
LogicalExpression = "LogicalExpression",
|
|
40
|
-
MemberExpression = "MemberExpression",
|
|
41
|
-
MethodDefinition = "MethodDefinition",
|
|
42
|
-
NewExpression = "NewExpression",
|
|
43
|
-
ObjectExpression = "ObjectExpression",
|
|
44
|
-
ObjectPattern = "ObjectPattern",
|
|
45
|
-
Program = "Program",
|
|
46
|
-
Property = "Property",
|
|
47
|
-
RestElement = "RestElement",
|
|
48
|
-
ReturnStatement = "ReturnStatement",
|
|
49
|
-
SequenceExpression = "SequenceExpression",
|
|
50
|
-
SpreadElement = "SpreadElement",
|
|
51
|
-
SwitchCase = "SwitchCase",
|
|
52
|
-
SwitchStatement = "SwitchStatement",
|
|
53
|
-
TaggedTemplateExpression = "TaggedTemplateExpression",
|
|
54
|
-
TemplateElement = "TemplateElement",
|
|
55
|
-
TemplateLiteral = "TemplateLiteral",
|
|
56
|
-
ThisExpression = "ThisExpression",
|
|
57
|
-
ThrowStatement = "ThrowStatement",
|
|
58
|
-
TryStatement = "TryStatement",
|
|
59
|
-
UnaryExpression = "UnaryExpression",
|
|
60
|
-
UpdateExpression = "UpdateExpression",
|
|
61
|
-
VariableDeclarator = "VariableDeclarator",
|
|
62
|
-
VariableDeclaration = "VariableDeclaration",
|
|
63
|
-
WhileStatement = "WhileStatement",
|
|
64
|
-
YieldExpression = "YieldExpression"
|
|
65
|
-
}
|
|
66
|
-
declare const nodes: {
|
|
67
|
-
[name: string]: typeof NodeBase;
|
|
68
|
-
};
|
|
69
|
-
export default nodes;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import Scope from "../../scopes/Scope";
|
|
2
|
-
import CallOptions from "../../CallOptions";
|
|
3
|
-
import ExecutionPathOptions from "../../ExecutionPathOptions";
|
|
4
|
-
import Identifier from "../Identifier";
|
|
5
|
-
import { ObjectPath } from "../../variables/VariableReassignmentTracker";
|
|
6
|
-
import ClassBody from "../ClassBody";
|
|
7
|
-
import { ExpressionNode, NodeBase } from "./Node";
|
|
8
|
-
export default class ClassNode extends NodeBase {
|
|
9
|
-
body: ClassBody;
|
|
10
|
-
superClass: ExpressionNode | null;
|
|
11
|
-
id: Identifier | null;
|
|
12
|
-
hasEffectsWhenAccessedAtPath(
|
|
13
|
-
path: ObjectPath,
|
|
14
|
-
_options: ExecutionPathOptions
|
|
15
|
-
): boolean;
|
|
16
|
-
hasEffectsWhenAssignedAtPath(
|
|
17
|
-
path: ObjectPath,
|
|
18
|
-
_options: ExecutionPathOptions
|
|
19
|
-
): boolean;
|
|
20
|
-
hasEffectsWhenCalledAtPath(
|
|
21
|
-
path: ObjectPath,
|
|
22
|
-
callOptions: CallOptions,
|
|
23
|
-
options: ExecutionPathOptions
|
|
24
|
-
): boolean;
|
|
25
|
-
initialiseChildren(_parentScope: Scope): void;
|
|
26
|
-
initialiseScope(parentScope: Scope): void;
|
|
27
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { WritableEntity } from "../../Entity";
|
|
2
|
-
import { ObjectPath } from "../../variables/VariableReassignmentTracker";
|
|
3
|
-
import CallOptions from "../../CallOptions";
|
|
4
|
-
import ExecutionPathOptions from "../../ExecutionPathOptions";
|
|
5
|
-
export declare type PredicateFunction = (node: ExpressionEntity) => boolean;
|
|
6
|
-
export declare type SomeReturnExpressionCallback = (
|
|
7
|
-
options: ExecutionPathOptions
|
|
8
|
-
) => PredicateFunction;
|
|
9
|
-
export declare type ForEachReturnExpressionCallback = (
|
|
10
|
-
options: ExecutionPathOptions
|
|
11
|
-
) => (node: ExpressionEntity) => void;
|
|
12
|
-
export interface ExpressionEntity extends WritableEntity {
|
|
13
|
-
/**
|
|
14
|
-
* Executes the callback on each possible return expression when calling this node.
|
|
15
|
-
*/
|
|
16
|
-
forEachReturnExpressionWhenCalledAtPath(
|
|
17
|
-
path: ObjectPath,
|
|
18
|
-
callOptions: CallOptions,
|
|
19
|
-
callback: ForEachReturnExpressionCallback,
|
|
20
|
-
options: ExecutionPathOptions
|
|
21
|
-
): void;
|
|
22
|
-
getValue(): any;
|
|
23
|
-
hasEffectsWhenAccessedAtPath(
|
|
24
|
-
path: ObjectPath,
|
|
25
|
-
options: ExecutionPathOptions
|
|
26
|
-
): boolean;
|
|
27
|
-
hasEffectsWhenCalledAtPath(
|
|
28
|
-
path: ObjectPath,
|
|
29
|
-
callOptions: CallOptions,
|
|
30
|
-
options: ExecutionPathOptions
|
|
31
|
-
): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Should return true if some possible return expression when called at the given
|
|
34
|
-
* path returns true.
|
|
35
|
-
*/
|
|
36
|
-
someReturnExpressionWhenCalledAtPath(
|
|
37
|
-
path: ObjectPath,
|
|
38
|
-
callOptions: CallOptions,
|
|
39
|
-
predicateFunction: SomeReturnExpressionCallback,
|
|
40
|
-
options: ExecutionPathOptions
|
|
41
|
-
): boolean;
|
|
42
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import FunctionScope from "../../scopes/FunctionScope";
|
|
2
|
-
import BlockScope from "../../scopes/FunctionScope";
|
|
3
|
-
import BlockStatement from "../BlockStatement";
|
|
4
|
-
import Identifier from "../Identifier";
|
|
5
|
-
import CallOptions from "../../CallOptions";
|
|
6
|
-
import ExecutionPathOptions from "../../ExecutionPathOptions";
|
|
7
|
-
import { ObjectPath } from "../../variables/VariableReassignmentTracker";
|
|
8
|
-
import { PatternNode } from "./Pattern";
|
|
9
|
-
import {
|
|
10
|
-
ForEachReturnExpressionCallback,
|
|
11
|
-
SomeReturnExpressionCallback
|
|
12
|
-
} from "./Expression";
|
|
13
|
-
import { NodeBase } from "./Node";
|
|
14
|
-
export default class FunctionNode extends NodeBase {
|
|
15
|
-
id: Identifier;
|
|
16
|
-
body: BlockStatement;
|
|
17
|
-
scope: BlockScope;
|
|
18
|
-
params: PatternNode[];
|
|
19
|
-
bindNode(): void;
|
|
20
|
-
forEachReturnExpressionWhenCalledAtPath(
|
|
21
|
-
path: ObjectPath,
|
|
22
|
-
callOptions: CallOptions,
|
|
23
|
-
callback: ForEachReturnExpressionCallback,
|
|
24
|
-
options: ExecutionPathOptions
|
|
25
|
-
): void;
|
|
26
|
-
hasEffects(options: ExecutionPathOptions): boolean;
|
|
27
|
-
hasEffectsWhenAccessedAtPath(path: ObjectPath): boolean;
|
|
28
|
-
hasEffectsWhenAssignedAtPath(path: ObjectPath): boolean;
|
|
29
|
-
hasEffectsWhenCalledAtPath(
|
|
30
|
-
path: ObjectPath,
|
|
31
|
-
callOptions: CallOptions,
|
|
32
|
-
options: ExecutionPathOptions
|
|
33
|
-
): boolean;
|
|
34
|
-
includeInBundle(): boolean;
|
|
35
|
-
initialiseScope(parentScope: FunctionScope): void;
|
|
36
|
-
someReturnExpressionWhenCalledAtPath(
|
|
37
|
-
path: ObjectPath,
|
|
38
|
-
callOptions: CallOptions,
|
|
39
|
-
predicateFunction: SomeReturnExpressionCallback,
|
|
40
|
-
options: ExecutionPathOptions
|
|
41
|
-
): boolean;
|
|
42
|
-
}
|