class

package
v1.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MakeVirtual = func(__proto__ interface{}, properties properties) {
	makeVirtual(__proto__.(prototype), properties)
}
View Source
var TypeError = func(prototype interface{}) error {
	return fmt.Errorf("%v is not a Class", reflect.TypeOf(prototype).String())
}

Functions

func ExampleClass

func ExampleClass()

func GetFunctionName

func GetFunctionName(i interface{}) string

Types

type Class

type Class struct {
	// contains filtered or unexported fields
}

抽象类,因为interface没有成员变量 通过class,将外部结构体转为接口

func (*Class) Invoke

func (c *Class) Invoke(method interface{}, args ...interface{}) []interface{}

func (*Class) InvokeByName

func (c *Class) InvokeByName(name string, args ...interface{}) []interface{}

call virtual method by name 后续增加虚函数表缓存策略

func (*Class) SetProperities

func (c *Class) SetProperities(properties properties)

func (*Class) SetProto

func (c *Class) SetProto(__proto__ prototype)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL