1
0
mirror of https://github.com/robertkrimen/otto synced 2025-10-05 19:19:10 +08:00
otto/console.go
Steven Hartland aefc75aabc
chore: update go and tools (#537)
Update to the oldest supported release of go v1.22 at this time.

Update golangci-lint to 1.61.0 and address all issues.

Update actions to the latest versions.
2024-11-03 16:40:47 +00:00

47 lines
1007 B
Go

package otto
import (
"fmt"
"os"
"strings"
)
func formatForConsole(argumentList []Value) string {
output := []string{}
for _, argument := range argumentList {
output = append(output, fmt.Sprintf("%v", argument))
}
return strings.Join(output, " ")
}
func builtinConsoleLog(call FunctionCall) Value {
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList)) //nolint:errcheck // Nothing we can do if this fails.
return Value{}
}
func builtinConsoleError(call FunctionCall) Value {
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList)) //nolint:errcheck // Nothing we can do if this fails.
return Value{}
}
// Nothing happens.
func builtinConsoleDir(call FunctionCall) Value {
return Value{}
}
func builtinConsoleTime(call FunctionCall) Value {
return Value{}
}
func builtinConsoleTimeEnd(call FunctionCall) Value {
return Value{}
}
func builtinConsoleTrace(call FunctionCall) Value {
return Value{}
}
func builtinConsoleAssert(call FunctionCall) Value {
return Value{}
}