Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse5

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse5 - npm Package Compare versions

Comparing version 2.1.4 to 2.1.5

24

lib/parser/stream.js

@@ -33,7 +33,7 @@ 'use strict';

this.parser = new Parser(options, this.scriptHandler.bind(this));
this.parser = new Parser(options);
this.lastChunkWritten = false;
this.writeCallback = null;
this.parserLoopLock = false;
this.pausedByScript = false;

@@ -52,2 +52,3 @@ /**

this._documentWrite = this._documentWrite.bind(this);
this._scriptHandler = this._scriptHandler.bind(this);

@@ -73,14 +74,7 @@ this.parser._bootstrap(this.document, null);

ParserStream.prototype._runParsingLoop = function () {
// NOTE: This helps avoid reentrant invocation of parsing loop
// in cases then `resume` called synchronously
// (see: https://github.com/inikulin/parse5/issues/98).
if (!this.parserLoopLock) {
this.parserLoopLock = true;
this.parser._runParsingLoop(this.writeCallback);
this.parserLoopLock = false;
}
this.parser._runParsingLoop(this.writeCallback, this._scriptHandler);
};
ParserStream.prototype._resume = function () {
if (!this.parser.pausedByScript)
if (!this.pausedByScript)
throw new Error('Parser was already resumed');

@@ -94,3 +88,3 @@

this.parser.pausedByScript = false;
this.pausedByScript = false;

@@ -107,5 +101,5 @@ //NOTE: keep parsing if we don't wait for the next input chunk

ParserStream.prototype.scriptHandler = function (scriptElement) {
ParserStream.prototype._scriptHandler = function (scriptElement) {
if (this.listeners('script').length) {
this.parser.pausedByScript = true;
this.pausedByScript = true;

@@ -148,3 +142,5 @@ /**

}
else
this._runParsingLoop();
};
{
"name": "parse5",
"description": "WHATWG HTML5 specification-compliant, fast and ready for production HTML parsing/serialization toolset for Node.js",
"version": "2.1.4",
"version": "2.1.5",
"author": "Ivan Nikulin <ifaaan@gmail.com> (https://github.com/inikulin)",

@@ -6,0 +6,0 @@ "contributors": [

@@ -31,2 +31,6 @@ <p align="center">

<p align="center">
<a href="https://github.com/inikulin/parse5/wiki/Documentation#version-history">Version history</a>
</p>
<p align="center">
<a href="http://astexplorer.net/#/1CHlCXc4n4">Online playground</a>

@@ -33,0 +37,0 @@ </p>

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc