Skip to content

Commit

Permalink
Regenerated
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonWoolf committed May 21, 2015
1 parent 1a038ee commit aaf716c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 10 deletions.
22 changes: 17 additions & 5 deletions browser/static/ably.js
Original file line number Diff line number Diff line change
Expand Up @@ -2506,7 +2506,7 @@ var BufferUtils = (function() {
var TextDecoder = window.TextDecoder;

function isWordArray(ob) { return ob.sigBytes !== undefined; }
function isArrayBuffer(ob) { return ob.constructor === ArrayBuffer; }
function isArrayBuffer(ob) { return ob.constructor && ob.constructor === ArrayBuffer; }

// https://gist.githubusercontent.com/jonleighton/958841/raw/f200e30dfe95212c0165ccf1ae000ca51e9de803/gistfile1.js
function arrayBufferToBase64(ArrayBuffer) {
Expand Down Expand Up @@ -4143,6 +4143,11 @@ var Utils = (function() {
return Object.prototype.toString.call(ob) == '[object Array]';
};

/* ...Or an Object (in the narrow sense) */
Utils.isObject = function(ob) {
return Object.prototype.toString.call(ob) == '[object Object]';
};

/*
* Determine whether or not an object contains
* any enumerable properties.
Expand Down Expand Up @@ -4477,11 +4482,18 @@ var Message = (function() {
};

Message.encode = function(msg, options) {
var data = msg.data, encoding;
if(data !== null && data !== undefined && typeof(data) != 'string' && !BufferUtils.isBuffer(data)) {
msg.data = JSON.stringify(data);
msg.encoding = (encoding = msg.encoding) ? (encoding + '/json') : 'json';
var data = msg.data, encoding,
nativeDataType = typeof(data) == 'string' || BufferUtils.isBuffer(data) || data === null || data === undefined;

if (!nativeDataType) {
if (Utils.isObject(data) || Utils.isArray(data)) {
msg.data = JSON.stringify(data);
msg.encoding = (encoding = msg.encoding) ? (encoding + '/json') : 'json';
} else {
throw new ErrorInfo('Data type is unsupported', 40011, 400);
}
}

if(options != null && options.encrypted)
Message.encrypt(msg, options);
};
Expand Down
22 changes: 17 additions & 5 deletions browser/static/ably.noencryption.js
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ var BufferUtils = (function() {
var TextDecoder = window.TextDecoder;

function isWordArray(ob) { return ob.sigBytes !== undefined; }
function isArrayBuffer(ob) { return ob.constructor === ArrayBuffer; }
function isArrayBuffer(ob) { return ob.constructor && ob.constructor === ArrayBuffer; }

// https://gist.githubusercontent.com/jonleighton/958841/raw/f200e30dfe95212c0165ccf1ae000ca51e9de803/gistfile1.js
function arrayBufferToBase64(ArrayBuffer) {
Expand Down Expand Up @@ -2795,6 +2795,11 @@ var Utils = (function() {
return Object.prototype.toString.call(ob) == '[object Array]';
};

/* ...Or an Object (in the narrow sense) */
Utils.isObject = function(ob) {
return Object.prototype.toString.call(ob) == '[object Object]';
};

/*
* Determine whether or not an object contains
* any enumerable properties.
Expand Down Expand Up @@ -3129,11 +3134,18 @@ var Message = (function() {
};

Message.encode = function(msg, options) {
var data = msg.data, encoding;
if(data !== null && data !== undefined && typeof(data) != 'string' && !BufferUtils.isBuffer(data)) {
msg.data = JSON.stringify(data);
msg.encoding = (encoding = msg.encoding) ? (encoding + '/json') : 'json';
var data = msg.data, encoding,
nativeDataType = typeof(data) == 'string' || BufferUtils.isBuffer(data) || data === null || data === undefined;

if (!nativeDataType) {
if (Utils.isObject(data) || Utils.isArray(data)) {
msg.data = JSON.stringify(data);
msg.encoding = (encoding = msg.encoding) ? (encoding + '/json') : 'json';
} else {
throw new ErrorInfo('Data type is unsupported', 40011, 400);
}
}

if(options != null && options.encrypted)
Message.encrypt(msg, options);
};
Expand Down
5 changes: 5 additions & 0 deletions browser/static/compat-pusher.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ var Utils = (function() {
return Object.prototype.toString.call(ob) == '[object Array]';
};

/* ...Or an Object (in the narrow sense) */
Utils.isObject = function(ob) {
return Object.prototype.toString.call(ob) == '[object Object]';
};

/*
* Determine whether or not an object contains
* any enumerable properties.
Expand Down
5 changes: 5 additions & 0 deletions browser/static/iframe-0.8.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@
return Object.prototype.toString.call(ob) == '[object Array]';
};

/* ...Or an Object (in the narrow sense) */
Utils.isObject = function(ob) {
return Object.prototype.toString.call(ob) == '[object Object]';
};

/*
* Determine whether or not an object contains
* any enumerable properties.
Expand Down
5 changes: 5 additions & 0 deletions browser/static/iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ var Utils = (function() {
return Object.prototype.toString.call(ob) == '[object Array]';
};

/* ...Or an Object (in the narrow sense) */
Utils.isObject = function(ob) {
return Object.prototype.toString.call(ob) == '[object Object]';
};

/*
* Determine whether or not an object contains
* any enumerable properties.
Expand Down

0 comments on commit aaf716c

Please sign in to comment.