reuse http parser on reinit, use simple props instead of descriptor for efficiency
This commit is contained in:
parent
c65b9d95a6
commit
f9747146ab
@ -120,19 +120,12 @@
|
||||
HTTPParser.prototype.reinitialize = function(type) {
|
||||
if (this._parser) {
|
||||
this._parser.free();
|
||||
} else {
|
||||
this._parser = new Parser();
|
||||
}
|
||||
delete this._parser;
|
||||
this._got_exception = null;
|
||||
|
||||
Object.defineProperty(this, '_parser', {
|
||||
value : new Parser(),
|
||||
configurable : true
|
||||
});
|
||||
Object.defineProperty(this, '_type', {
|
||||
value : type,
|
||||
writable : true
|
||||
});
|
||||
this._type = type;
|
||||
this._parser.init(valueOf(typeClass, type));
|
||||
this._got_exception = null;
|
||||
}
|
||||
|
||||
HTTPParser.prototype.execute = function(data, start, length) {
|
||||
|
Loading…
Reference in New Issue
Block a user