MCPcopy Create free account
hub / github.com/angular/dev-infra / parseCloseBody

Method parseCloseBody

github-actions/browserstack/set-browserstack-env.js:18054–18073  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

18052 __privateSet(this, _byteOffset, __privateGet(this, _byteOffset) + chunk.length);
18053 __privateSet(this, _loop, true);
18054 this.run(callback);
18055 }
18056 /**
18057 * Runs whenever a new chunk is received.
18058 * Callback is called whenever there are no more chunks buffering,
18059 * or not enough bytes are buffered to parse.
18060 */
18061 run(callback) {
18062 while (__privateGet(this, _loop)) {
18063 if (__privateGet(this, _state) === parserStates.INFO) {
18064 if (__privateGet(this, _byteOffset) < 2) {
18065 return callback();
18066 }
18067 const buffer = this.consume(2);
18068 const fin = (buffer[0] & 128) !== 0;
18069 const opcode = buffer[0] & 15;
18070 const masked = (buffer[1] & 128) === 128;
18071 const fragmented = !fin && opcode !== opcodes.CONTINUATION;
18072 const payloadLength = buffer[1] & 127;
18073 const rsv1 = buffer[0] & 64;
18074 const rsv2 = buffer[0] & 32;
18075 const rsv3 = buffer[0] & 16;
18076 if (!isValidOpcode(opcode)) {

Callers 1

parseControlFrameMethod · 0.45

Calls 1

isValidStatusCodeFunction · 0.70

Tested by

no test coverage detected