From 3c2c99ab74f508af4b9fc95abc4c75d6a334fbc2 Mon Sep 17 00:00:00 2001 From: Raynos Date: Thu, 19 Dec 2019 17:31:06 +0100 Subject: [PATCH] regenerate lib/parser.js --- lib/parser.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/parser.js b/lib/parser.js index cbcc8f3c..59f4d545 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript 1.12.7 (function() { "use strict"; - var bom, defaults, events, isEmpty, processItem, processors, promisify, sax, setImmediate, + var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; @@ -18,8 +18,6 @@ defaults = require('./defaults').defaults; - promisify = require('util.promisify'); - isEmpty = function(thing) { return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0; }; @@ -335,7 +333,17 @@ }; Parser.prototype.parseStringPromise = function(str) { - return promisify(this.parseString)(str); + return new Promise((function(_this) { + return function(resolve, reject) { + return _this.parseString(str, function(err, value) { + if (err) { + return reject(err); + } else { + return resolve(value); + } + }); + }; + })(this)); }; return Parser;