From 7ad0051830e073adce7e1f66996951ada2d70053 Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Mon, 31 Aug 2015 17:14:00 -0400 Subject: [PATCH 1/4] fix browserify support for async parsing --- src/xml2js.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xml2js.coffee b/src/xml2js.coffee index bfc8086e..d651f1ee 100644 --- a/src/xml2js.coffee +++ b/src/xml2js.coffee @@ -5,6 +5,7 @@ events = require 'events' builder = require 'xmlbuilder' bom = require './bom' processors = require './processors' +global.setImmediate = require('timers').setImmediate # Underscore has a nice function for this, but we try to go without dependencies isEmpty = (thing) -> From 8c9d1057962fa3feae3f03a5c970f364c464be46 Mon Sep 17 00:00:00 2001 From: Tristian Flanagan Date: Mon, 31 Aug 2015 17:34:11 -0400 Subject: [PATCH 2/4] remove global tampering --- src/xml2js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xml2js.coffee b/src/xml2js.coffee index d651f1ee..bc0d6372 100644 --- a/src/xml2js.coffee +++ b/src/xml2js.coffee @@ -5,7 +5,7 @@ events = require 'events' builder = require 'xmlbuilder' bom = require './bom' processors = require './processors' -global.setImmediate = require('timers').setImmediate +setImmediate = require('timers').setImmediate # Underscore has a nice function for this, but we try to go without dependencies isEmpty = (thing) -> From 43235366b0961ed86b9f3308ed59ef1c2f334c55 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Mon, 31 Aug 2015 23:44:24 +0200 Subject: [PATCH 3/4] Credit Tristian --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 15e02d62..05ad89ee 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,8 @@ "Benjamin E. Coe (https://twitter.com/benjamincoe)", "Stephen Cresswell (https://github.com/cressie176)", "Pascal Ehlert (http://www.hacksrus.net/)", - "Tom Spencer (http://fiznool.com/)" + "Tom Spencer (http://fiznool.com/)", + "Tristian Flanagan (https://github.com/tflanagan)" ], "main": "./lib/xml2js", "directories": { From dc95d9856496a5926fcbb25db30dcec0926378c4 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Mon, 31 Aug 2015 23:48:10 +0200 Subject: [PATCH 4/4] Compile JavaScript artefacts --- lib/xml2js.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/xml2js.js b/lib/xml2js.js index 354081e1..452c0ebe 100644 --- a/lib/xml2js.js +++ b/lib/xml2js.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript 1.9.3 (function() { "use strict"; - var bom, builder, escapeCDATA, events, isEmpty, processName, processors, requiresCDATA, sax, wrapCDATA, + var bom, builder, escapeCDATA, events, isEmpty, processName, processors, requiresCDATA, sax, setImmediate, wrapCDATA, 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, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; @@ -16,6 +16,8 @@ processors = require('./processors'); + setImmediate = require('timers').setImmediate; + isEmpty = function(thing) { return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0; };