renamer

package
v0.8.53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignNestedScopeSlots

func AssignNestedScopeSlots(moduleScope *js_ast.Scope, symbols []js_ast.Symbol) (slotCounts js_ast.SlotCounts)

Returns the number of nested slots

func ComputeReservedNames

func ComputeReservedNames(moduleScopes []*js_ast.Scope, symbols js_ast.SymbolMap) map[string]uint32

Types

type ExportRenamer

type ExportRenamer struct {
	// contains filtered or unexported fields
}

func (*ExportRenamer) NextMinifiedName

func (r *ExportRenamer) NextMinifiedName() string

func (*ExportRenamer) NextRenamedName

func (r *ExportRenamer) NextRenamedName(name string) string

type MinifyRenamer

type MinifyRenamer struct {
	// contains filtered or unexported fields
}

func NewMinifyRenamer

func NewMinifyRenamer(symbols js_ast.SymbolMap, firstTopLevelSlots js_ast.SlotCounts, reservedNames map[string]uint32) *MinifyRenamer

func (*MinifyRenamer) AccumulateSymbolCount

func (r *MinifyRenamer) AccumulateSymbolCount(ref js_ast.Ref, count uint32)

func (*MinifyRenamer) AccumulateSymbolUseCounts

func (r *MinifyRenamer) AccumulateSymbolUseCounts(symbolUses map[js_ast.Ref]js_ast.SymbolUse, stableSourceIndices []uint32)

func (*MinifyRenamer) AssignNamesByFrequency

func (r *MinifyRenamer) AssignNamesByFrequency(minifier *js_ast.NameMinifier)

func (*MinifyRenamer) NameForSymbol

func (r *MinifyRenamer) NameForSymbol(ref js_ast.Ref) string

type NumberRenamer

type NumberRenamer struct {
	// contains filtered or unexported fields
}

func NewNumberRenamer

func NewNumberRenamer(symbols js_ast.SymbolMap, reservedNames map[string]uint32) *NumberRenamer

func (*NumberRenamer) AddTopLevelSymbol

func (r *NumberRenamer) AddTopLevelSymbol(ref js_ast.Ref)

func (*NumberRenamer) AssignNamesByScope

func (r *NumberRenamer) AssignNamesByScope(nestedScopes map[uint32][]*js_ast.Scope)

func (*NumberRenamer) NameForSymbol

func (r *NumberRenamer) NameForSymbol(ref js_ast.Ref) string

type Renamer

type Renamer interface {
	NameForSymbol(ref js_ast.Ref) string
}

func NewNoOpRenamer

func NewNoOpRenamer(symbols js_ast.SymbolMap) Renamer

type StableRef

type StableRef struct {
	StableOuterIndex uint32
	Ref              js_ast.Ref
}

type StableRefArray

type StableRefArray []StableRef

This type is just so we can use Go's native sort function

func (StableRefArray) Len

func (a StableRefArray) Len() int

func (StableRefArray) Less

func (a StableRefArray) Less(i int, j int) bool

func (StableRefArray) Swap

func (a StableRefArray) Swap(i int, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL