Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix some typos #1139

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

Merged
merged 1 commit into from
Aug 17, 2022
Merged
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
2 changes: 1 addition & 1 deletion compiler/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ func (fc *funcContext) translateCall(e *ast.CallExpr, sig *types.Signature, fun
return fc.formatExpr("%s(%s)", fun, strings.Join(args, ", "))
}

// delegatedCall returns a pair of JS expresions representing a callable function
// delegatedCall returns a pair of JS expressions representing a callable function
// and its arguments to be invoked elsewhere.
//
// This function is necessary in conjunction with keywords such as `go` and `defer`,
Expand Down
11 changes: 6 additions & 5 deletions compiler/natives/src/math/math_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"testing"
)

// Slighly higher tolerances than upstream, otherwise TestGamma fails.
// Slightly higher tolerances than upstream, otherwise TestGamma fails.
// TODO: Is there a better way to fix TestGamma? It's weird that only one test
// requires increasing tolerances. Perhaps there's a better fix? Maybe we
// should override TestGamma specifically and not the package-wide tolerances,
// because this will cause many other tests to be less accurate. Or maybe this
// is fine?
//
// requires increasing tolerances. Perhaps there's a better fix? Maybe we
// should override TestGamma specifically and not the package-wide tolerances,
// because this will cause many other tests to be less accurate. Or maybe this
// is fine?
func close(a, b float64) bool { return tolerance(a, b, 4e-14) }
func veryclose(a, b float64) bool { return tolerance(a, b, 6e-15) }

Expand Down
2 changes: 1 addition & 1 deletion compiler/statements.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (fc *funcContext) translateStmt(stmt ast.Stmt, label *types.Label) {
case token.FALLTHROUGH:
// handled in CaseClause
default:
panic("Unhandled branch statment: " + s.Tok.String())
panic("Unhandled branch statement: " + s.Tok.String())
}

case *ast.ReturnStmt:
Expand Down
2 changes: 1 addition & 1 deletion js/js.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func MakeWrapper(i interface{}) *Object {
// and setters
// (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty)
// for the non-embedded exported fields of i. Values accessed via these methods
// and getters are themsevles wrapped when accessed, but an important point to
// and getters are themselves wrapped when accessed, but an important point to
// note is that a new wrapped value is created on each access.
func MakeFullWrapper(i interface{}) *Object {
internalObj := InternalObject(i)
Expand Down
4 changes: 2 additions & 2 deletions tests/testdata/time_inexternalization.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
var _ = time.Sleep // Force "time" package to be imported but let time.Time and time.Unix be DCEed since they're not used.

func main() {
// Excercise externalization of Go struct (with its special handling of time.Time).
// Exercise externalization of Go struct (with its special handling of time.Time).
js.Global.Get("console").Call("log", struct{ S string }{"externalization ok"})

// Excercise internalization of JavaScript Date object (with its special handling of time.Time).
// Exercise internalization of JavaScript Date object (with its special handling of time.Time).
date := js.Global.Get("Date").New("2015-08-29T20:56:00.869Z").Interface()
js.Global.Set("myDate", date)
js.Global.Get("console").Call("log", js.Global.Get("myDate").Call("toUTCString"))
Expand Down