Files
moxa/stdlib/go1_15_image_jpeg.go
Marc Vertes fc970799a1 interp: add support of interface wrappers to type assertions
Store the interpreter value of the interface object to wrap as
a field called IValue, at offset 0 in wrapper structures.

Update extract to include IValue field.

In typeAssert, detect interface wrapper, and dereference the
interpreter value from IValue wrapper field.

Fixes #1166.
2021-07-12 17:10:13 +02:00

42 lines
1.2 KiB
Go

// Code generated by 'yaegi extract image/jpeg'. DO NOT EDIT.
// +build go1.15,!go1.16
package stdlib
import (
"go/constant"
"go/token"
"image/jpeg"
"reflect"
)
func init() {
Symbols["image/jpeg/jpeg"] = map[string]reflect.Value{
// function, constant and variable definitions
"Decode": reflect.ValueOf(jpeg.Decode),
"DecodeConfig": reflect.ValueOf(jpeg.DecodeConfig),
"DefaultQuality": reflect.ValueOf(constant.MakeFromLiteral("75", token.INT, 0)),
"Encode": reflect.ValueOf(jpeg.Encode),
// type definitions
"FormatError": reflect.ValueOf((*jpeg.FormatError)(nil)),
"Options": reflect.ValueOf((*jpeg.Options)(nil)),
"Reader": reflect.ValueOf((*jpeg.Reader)(nil)),
"UnsupportedError": reflect.ValueOf((*jpeg.UnsupportedError)(nil)),
// interface wrapper definitions
"_Reader": reflect.ValueOf((*_image_jpeg_Reader)(nil)),
}
}
// _image_jpeg_Reader is an interface wrapper for Reader type
type _image_jpeg_Reader struct {
IValue interface{}
WRead func(p []byte) (n int, err error)
WReadByte func() (byte, error)
}
func (W _image_jpeg_Reader) Read(p []byte) (n int, err error) { return W.WRead(p) }
func (W _image_jpeg_Reader) ReadByte() (byte, error) { return W.WReadByte() }