Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct spelling errors in comments and documentation #502

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions _tools/customlint/testdata/shadow/shadow.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func F17(read func() (v any, err error), sendError func(error) error) error {
v, err := read()
if err != nil {
if err == errSome {
// OK: use after asignnent above; switching to = below would not be observable.
// OK: use after assignment above; switching to = below would not be observable.
if err := sendError(err); err != nil {
return err
}
Expand All @@ -287,7 +287,7 @@ func F17b(read func() (v any, err error), sendError func(error) error) error {
return err
}
if v == "bad value" {
// OK: use after asignnent above; switching to = below would not be observable.
// OK: use after assignment above; switching to = below would not be observable.
if err := sendError(err); err != nil {
return err
}
Expand All @@ -302,7 +302,7 @@ func F18(index int) int {
}

if index == 1 {
// Dubuious; did this mean to keep the value for another execution?
// Dubious; did this mean to keep the value for another execution?
index := 2
println(index)
return index
Expand Down
2 changes: 1 addition & 1 deletion internal/ast/precedence.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const (
OperatorPrecedenceLogicalOR
// LogicalANDExpression:
// BitwiseORExpression
// LogicalANDExprerssion `&&` BitwiseORExpression
// LogicalANDExpression `&&` BitwiseORExpression
OperatorPrecedenceLogicalAND
// BitwiseORExpression:
// BitwiseXORExpression
Expand Down
2 changes: 1 addition & 1 deletion internal/ast/symbolflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const (
SymbolFlagsPropertyExcludes = SymbolFlagsValue & ^SymbolFlagsProperty
SymbolFlagsEnumMemberExcludes = SymbolFlagsValue | SymbolFlagsType
SymbolFlagsFunctionExcludes = SymbolFlagsValue & ^(SymbolFlagsFunction | SymbolFlagsValueModule | SymbolFlagsClass)
SymbolFlagsClassExcludes = (SymbolFlagsValue | SymbolFlagsType) & ^(SymbolFlagsValueModule | SymbolFlagsInterface | SymbolFlagsFunction) // class-interface mergability done in checker.ts
SymbolFlagsClassExcludes = (SymbolFlagsValue | SymbolFlagsType) & ^(SymbolFlagsValueModule | SymbolFlagsInterface | SymbolFlagsFunction) // class-interface mergeability done in checker.ts
SymbolFlagsInterfaceExcludes = SymbolFlagsType & ^(SymbolFlagsInterface | SymbolFlagsClass)
SymbolFlagsRegularEnumExcludes = (SymbolFlagsValue | SymbolFlagsType) & ^(SymbolFlagsRegularEnum | SymbolFlagsValueModule) // regular enums merge only with regular enums and modules
SymbolFlagsConstEnumExcludes = (SymbolFlagsValue | SymbolFlagsType) & ^SymbolFlagsConstEnum // const enums merge only with const enums
Expand Down
2 changes: 1 addition & 1 deletion internal/ast/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ func IsCommaExpression(node *Node) bool {

func IsCommaSequence(node *Node) bool {
// !!!
// New compiler just has binary expressinons.
// New compiler just has binary expressions.
// Maybe this should consider KindCommaListExpression even though we don't generate them.
return IsCommaExpression(node)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/checker/emitresolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (r *emitResolver) isAliasResolvedToValue(symbol *ast.Symbol, excludeTypeOnl
if container := ast.GetSourceFileOfNode(symbol.ValueDeclaration); container != nil {
fileSymbol := c.getSymbolOfDeclaration(container.AsNode())
// Ensures cjs export assignment is setup, since this symbol may point at, and merge with, the file itself.
// If we don't, the merge may not have yet occured, and the flags check below will be missing flags that
// If we don't, the merge may not have yet occurred, and the flags check below will be missing flags that
// are added as a result of the merge.
c.resolveExternalModuleSymbol(fileSymbol, false /*dontResolveAlias*/)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/checker/inference.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (c *Checker) inferFromTypes(n *InferenceState, source *Type, target *Type)
} else if target.flags&TypeFlagsIndexedAccess != 0 {
indexType := c.getSimplifiedType(target.AsIndexedAccessType().indexType, false /*writing*/)
// Generally simplifications of instantiable indexes are avoided to keep relationship checking correct, however if our target is an access, we can consider
// that key of that access to be "instantiated", since we're looking to find the infernce goal in any way we can.
// that key of that access to be "instantiated", since we're looking to find the inference goal in any way we can.
if indexType.flags&TypeFlagsInstantiable != 0 {
simplified := c.distributeIndexOverObjectType(c.getSimplifiedType(target.AsIndexedAccessType().objectType, false /*writing*/), indexType, false /*writing*/)
if simplified != nil && simplified != target {
Expand Down
2 changes: 1 addition & 1 deletion internal/checker/relater.go
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,7 @@ func (r *Relater) hasExcessProperties(source *Type, target *Type, reportErrors b
}
if ast.IsJsxAttributes(r.errorNode) || isJsxOpeningLikeElement(r.errorNode) || isJsxOpeningLikeElement(r.errorNode.Parent) {
// !!!
// // JsxAttributes has an object-literal flag and undergo same type-assignablity check as normal object-literal.
// // JsxAttributes has an object-literal flag and undergo same type-assignability check as normal object-literal.
// // However, using an object-literal error message will be very confusing to the users so we give different a message.
// if prop.valueDeclaration && isJsxAttribute(prop.valueDeclaration) && ast.GetSourceFileOfNode(errorNode) == ast.GetSourceFileOfNode(prop.valueDeclaration.name) {
// // Note that extraneous children (as in `<NoChild>extra</NoChild>`) don't pass this check,
Expand Down