gopherjs:replace
(typ Type, len, cap int)
| 142 | |
| 143 | //gopherjs:replace |
| 144 | func MakeSlice(typ Type, len, cap int) Value { |
| 145 | if typ.Kind() != Slice { |
| 146 | panic("reflect.MakeSlice of non-slice type") |
| 147 | } |
| 148 | if len < 0 { |
| 149 | panic("reflect.MakeSlice: negative len") |
| 150 | } |
| 151 | if cap < 0 { |
| 152 | panic("reflect.MakeSlice: negative cap") |
| 153 | } |
| 154 | if len > cap { |
| 155 | panic("reflect.MakeSlice: len > cap") |
| 156 | } |
| 157 | |
| 158 | return makeValue(toAbiType(typ), js.Global.Call("$makeSlice", jsType(typ), len, cap, js.InternalObject(func() *js.Object { return jsType(typ.Elem()).Call("zero") })), 0) |
| 159 | } |
| 160 | |
| 161 | //gopherjs:replace |
| 162 | func TypeOf(i any) Type { |