rum-goggles/vendor/github.com/robertkrimen/otto/console.go
2024-02-23 11:39:16 -05:00

47 lines
899 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))
return Value{}
}
func builtinConsoleError(call FunctionCall) Value {
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
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{}
}