Skip to content

Commit 7b68975

Browse files
gballetfjl
authored andcommitted
console, internal/jsre: use github.com/dop251/goja (#20470)
This replaces the JavaScript interpreter used by the console with goja, which is actively maintained and a lot faster than otto. Clef still uses otto and eth/tracers still uses duktape, so we are currently dependent on three different JS interpreters. We're looking to replace the remaining uses of otto soon though.
1 parent 60deeb1 commit 7b68975

File tree

11 files changed

+559
-477
lines changed

11 files changed

+559
-477
lines changed

cmd/geth/consolecmd_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ func TestConsoleWelcome(t *testing.T) {
5151
geth.SetTemplateFunc("goarch", func() string { return runtime.GOARCH })
5252
geth.SetTemplateFunc("gover", runtime.Version)
5353
geth.SetTemplateFunc("gethver", func() string { return params.VersionWithCommit("", "") })
54-
geth.SetTemplateFunc("niltime", func() string { return time.Unix(0, 0).Format(time.RFC1123) })
54+
geth.SetTemplateFunc("niltime", func() string {
55+
return time.Unix(0, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)")
56+
})
5557
geth.SetTemplateFunc("apis", func() string { return ipcAPIs })
5658

5759
// Verify the actual welcome message to the required template
@@ -142,7 +144,9 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) {
142144
attach.SetTemplateFunc("gover", runtime.Version)
143145
attach.SetTemplateFunc("gethver", func() string { return params.VersionWithCommit("", "") })
144146
attach.SetTemplateFunc("etherbase", func() string { return geth.Etherbase })
145-
attach.SetTemplateFunc("niltime", func() string { return time.Unix(0, 0).Format(time.RFC1123) })
147+
attach.SetTemplateFunc("niltime", func() string {
148+
return time.Unix(0, 0).Format("Mon Jan 02 2006 15:04:05 GMT-0700 (MST)")
149+
})
146150
attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") })
147151
attach.SetTemplateFunc("datadir", func() string { return geth.Datadir })
148152
attach.SetTemplateFunc("apis", func() string { return apis })

0 commit comments

Comments
 (0)