- Sort Score
- Result 10 results
- Languages All
Results 1 - 6 of 6 for CopyBytesToJS (0.23 sec)
-
src/syscall/js/js.go
// CopyBytesToJS copies bytes from src to dst. // It panics if dst is not a Uint8Array or Uint8ClampedArray. // It returns the number of bytes copied, which will be the minimum of the lengths of src and dst. func CopyBytesToJS(dst Value, src []byte) int { n, ok := copyBytesToJS(dst.ref, src) runtime.KeepAlive(dst) if !ok {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 19 14:35:26 UTC 2024 - 19.5K bytes - Viewed (0) -
src/syscall/fs_js.go
} if faketime && (fd == 1 || fd == 2) { n := faketimeWrite(fd, b) if n < 0 { return 0, errnoErr(Errno(-n)) } return n, nil } buf := uint8Array.New(len(b)) js.CopyBytesToJS(buf, b) n, err := fsCall("write", fd, buf, 0, len(b), nil) if err != nil { return 0, err } n2 := n.Int() f.pos += int64(n2) return n2, err }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 11 18:19:17 UTC 2023 - 10.8K bytes - Viewed (0) -
misc/wasm/wasm_exec.js
const toCopy = src.subarray(0, dst.length); dst.set(toCopy); setInt64(sp + 40, toCopy.length); this.mem.setUint8(sp + 48, 1); }, // func copyBytesToJS(dst ref, src []byte) (int, bool) "syscall/js.copyBytesToJS": (sp) => { sp >>>= 0; const dst = loadValue(sp + 8); const src = loadSlice(sp + 16); if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon May 22 17:47:47 UTC 2023 - 16.3K bytes - Viewed (0) -
src/net/http/roundtrip_js.go
if err != nil { req.Body.Close() // RoundTrip must always close the body, including on errors. return nil, err } req.Body.Close() if len(body) != 0 { buf := uint8Array.New(len(body)) js.CopyBytesToJS(buf, body) opt.Set("body", buf) } } fetchPromise := js.Global().Call("fetch", req.URL.String(), opt) var ( respCh = make(chan *Response, 1) errCh = make(chan error, 1)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Jan 10 03:29:50 UTC 2024 - 11.8K bytes - Viewed (0) -
src/syscall/js/js_test.go
src := make([]byte, tt.srcLen) if tt.srcLen >= 2 { src[1] = 42 } dst := js.Global().Get("Uint8Array").New(tt.dstLen) if got, want := js.CopyBytesToJS(dst, src), tt.copyLen; got != want { t.Errorf("copied %d, want %d", got, want) } if tt.dstLen >= 2 { if got, want := dst.Index(1).Int(), 42; got != want { t.Errorf("got %d, want %d", got, want)
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Apr 19 14:35:26 UTC 2024 - 17.7K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"XP1_SUPPORT_BROADCAST", Const, 2}, {"XP1_SUPPORT_MULTIPOINT", Const, 2}, {"XP1_UNI_RECV", Const, 2}, {"XP1_UNI_SEND", Const, 2}, }, "syscall/js": { {"CopyBytesToGo", Func, 0}, {"CopyBytesToJS", Func, 0}, {"Error", Type, 0}, {"Func", Type, 0}, {"FuncOf", Func, 0}, {"Global", Func, 0}, {"Null", Func, 0}, {"Type", Type, 0}, {"TypeBoolean", Const, 0},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0)