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 9decb6c commit fe74a1d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 12 deletions.
25 changes: 19 additions & 6 deletions browser/static/ably.js
Original file line number Diff line number Diff line change
Expand Up @@ -2505,8 +2505,8 @@ var BufferUtils = (function() {
var ArrayBuffer = window.ArrayBuffer;
var TextDecoder = window.TextDecoder;

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

// https://gist.githubusercontent.com/jonleighton/958841/raw/f200e30dfe95212c0165ccf1ae000ca51e9de803/gistfile1.js
function arrayBufferToBase64(ArrayBuffer) {
Expand Down Expand Up @@ -2626,6 +2626,7 @@ var BufferUtils = (function() {

return BufferUtils;
})();

var Cookie = (function() {
var isBrowser = (typeof(window) == 'object');
function noop() {}
Expand Down Expand Up @@ -4143,6 +4144,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 +4483,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
25 changes: 19 additions & 6 deletions browser/static/ably.noencryption.js
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,8 @@ var BufferUtils = (function() {
var ArrayBuffer = window.ArrayBuffer;
var TextDecoder = window.TextDecoder;

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

// https://gist.githubusercontent.com/jonleighton/958841/raw/f200e30dfe95212c0165ccf1ae000ca51e9de803/gistfile1.js
function arrayBufferToBase64(ArrayBuffer) {
Expand Down Expand Up @@ -1278,6 +1278,7 @@ var BufferUtils = (function() {

return BufferUtils;
})();

var Cookie = (function() {
var isBrowser = (typeof(window) == 'object');
function noop() {}
Expand Down Expand Up @@ -2795,6 +2796,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 +3135,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 fe74a1d

Please sign in to comment.