Builtin == now throws when given 0 argument.

This commit is contained in:
Qi Xiao 2016-09-15 15:31:08 +02:00
parent d38f5feefc
commit 3fdd289105

View File

@ -842,8 +842,7 @@ func boolFn(ec *EvalCtx, v Value) {
func eq(ec *EvalCtx, args []Value, opts map[string]Value) {
TakeNoOpt(opts)
if len(args) == 0 {
ec.falsify()
return
throw(ErrArgs)
}
for i := 0; i+1 < len(args); i++ {
if args[i] != args[i+1] {