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; }; 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": { diff --git a/src/xml2js.coffee b/src/xml2js.coffee index bfc8086e..bc0d6372 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' +setImmediate = require('timers').setImmediate # Underscore has a nice function for this, but we try to go without dependencies isEmpty = (thing) ->