MCPcopy Create free account
hub / github.com/creationix/http-parser-js / newParser

Function newParser

tests/parallel/test-http-parser.js:26–48  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

24
25
26function newParser(type) {
27 var parser = new HTTPParser(type);
28
29 parser.headers = [];
30 parser.url = '';
31
32 parser[kOnHeaders] = function(headers, url) {
33 parser.headers = parser.headers.concat(headers);
34 parser.url += url;
35 };
36
37 parser[kOnHeadersComplete] = function(info) {
38 };
39
40 parser[kOnBody] = function(b, start, len) {
41 assert.ok(false, 'Function should not be called.');
42 };
43
44 parser[kOnMessageComplete] = function() {
45 };
46
47 return parser;
48}
49
50
51function mustCall(f, times) {

Callers 2

testFunction · 0.85

Calls

no outgoing calls

Tested by 1

testFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…