forked from lug/matterbridge
Update vendor d5/tengo
This commit is contained in:
5
vendor/github.com/d5/tengo/objects/bytes.go
generated
vendored
5
vendor/github.com/d5/tengo/objects/bytes.go
generated
vendored
@@ -3,6 +3,7 @@ package objects
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/d5/tengo"
|
||||
"github.com/d5/tengo/compiler/token"
|
||||
)
|
||||
|
||||
@@ -27,6 +28,10 @@ func (o *Bytes) BinaryOp(op token.Token, rhs Object) (Object, error) {
|
||||
case token.Add:
|
||||
switch rhs := rhs.(type) {
|
||||
case *Bytes:
|
||||
if len(o.Value)+len(rhs.Value) > tengo.MaxBytesLen {
|
||||
return nil, ErrBytesLimit
|
||||
}
|
||||
|
||||
return &Bytes{Value: append(o.Value, rhs.Value...)}, nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user