mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-19 16:20:53 +00:00
5b5cae693f
Events with just 1 argument fail before this change Former-commit-id: 69cbb51c56054208417e464dc6e46a94ccb3bbeb [formerly fbb03244929beb0ce8f9c607ce33d107e8319b89] Former-commit-id: 984154c1ba79f1fe8bf0106a604b2765ea312079
52 lines
993 B
Go
52 lines
993 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 builtinConsole_log(call FunctionCall) Value {
|
|
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
|
|
return Value{}
|
|
}
|
|
|
|
func builtinConsole_error(call FunctionCall) Value {
|
|
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
|
|
return Value{}
|
|
}
|
|
|
|
// Nothing happens.
|
|
func builtinConsole_dir(call FunctionCall) Value {
|
|
return Value{}
|
|
}
|
|
|
|
func builtinConsole_time(call FunctionCall) Value {
|
|
return Value{}
|
|
}
|
|
|
|
func builtinConsole_timeEnd(call FunctionCall) Value {
|
|
return Value{}
|
|
}
|
|
|
|
func builtinConsole_trace(call FunctionCall) Value {
|
|
return Value{}
|
|
}
|
|
|
|
func builtinConsole_assert(call FunctionCall) Value {
|
|
return Value{}
|
|
}
|
|
|
|
func (runtime *_runtime) newConsole() *_object {
|
|
|
|
return newConsoleObject(runtime)
|
|
}
|