rum-goggles/v1/vendor/github.com/robertkrimen/otto/console.go

47 lines
899 B
Go
Raw Normal View History

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, " ")
}
2024-04-04 14:46:14 +00:00
func builtinConsoleLog(call FunctionCall) Value {
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
return Value{}
}
2024-04-04 14:46:14 +00:00
func builtinConsoleError(call FunctionCall) Value {
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
return Value{}
}
// Nothing happens.
2024-04-04 14:46:14 +00:00
func builtinConsoleDir(call FunctionCall) Value {
return Value{}
}
2024-04-04 14:46:14 +00:00
func builtinConsoleTime(call FunctionCall) Value {
return Value{}
}
2024-04-04 14:46:14 +00:00
func builtinConsoleTimeEnd(call FunctionCall) Value {
return Value{}
}
2024-04-04 14:46:14 +00:00
func builtinConsoleTrace(call FunctionCall) Value {
return Value{}
}
2024-04-04 14:46:14 +00:00
func builtinConsoleAssert(call FunctionCall) Value {
return Value{}
}