mirror of https://github.com/ethereum/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
993 B
52 lines
993 B
10 years ago
|
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))
|
||
10 years ago
|
return Value{}
|
||
10 years ago
|
}
|
||
|
|
||
|
func builtinConsole_error(call FunctionCall) Value {
|
||
|
fmt.Fprintln(os.Stdout, formatForConsole(call.ArgumentList))
|
||
10 years ago
|
return Value{}
|
||
10 years ago
|
}
|
||
|
|
||
|
// Nothing happens.
|
||
|
func builtinConsole_dir(call FunctionCall) Value {
|
||
10 years ago
|
return Value{}
|
||
10 years ago
|
}
|
||
|
|
||
|
func builtinConsole_time(call FunctionCall) Value {
|
||
10 years ago
|
return Value{}
|
||
10 years ago
|
}
|
||
|
|
||
|
func builtinConsole_timeEnd(call FunctionCall) Value {
|
||
10 years ago
|
return Value{}
|
||
10 years ago
|
}
|
||
|
|
||
|
func builtinConsole_trace(call FunctionCall) Value {
|
||
10 years ago
|
return Value{}
|
||
10 years ago
|
}
|
||
|
|
||
|
func builtinConsole_assert(call FunctionCall) Value {
|
||
10 years ago
|
return Value{}
|
||
10 years ago
|
}
|
||
|
|
||
|
func (runtime *_runtime) newConsole() *_object {
|
||
|
|
||
|
return newConsoleObject(runtime)
|
||
|
}
|