MCPcopy Index your code
hub / github.com/nodejs/node / newParser

Function newParser

test/parallel/test-http-parser.js:40–61  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

38
39
40function newParser(type) {
41 const parser = new HTTPParser();
42 parser.initialize(type, {});
43
44 parser.headers = [];
45 parser.url = '';
46
47 parser[kOnHeaders] = function(headers, url) {
48 parser.headers = parser.headers.concat(headers);
49 parser.url += url;
50 };
51
52 parser[kOnHeadersComplete] = function() {
53 };
54
55 parser[kOnBody] = mustNotCall('kOnBody should not be called');
56
57 parser[kOnMessageComplete] = function() {
58 };
59
60 return parser;
61}
62
63
64function expectBody(expected) {

Callers 2

testFunction · 0.70

Calls 3

concatMethod · 0.80
mustNotCallFunction · 0.70
initializeMethod · 0.45

Tested by 1

testFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…