Skip to content

Commit 05bcc5d

Browse files
author
www-data
committed
Merge remote-tracking branch 'upstream/master'
2 parents faad454 + 1c9ec8c commit 05bcc5d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/jsboot/service/client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ jsBoot.pack('jsBoot.service', function(api) {
183183

184184
if (success && !this.error)
185185
success(this.data);
186+
// XXX Roxee depends on this old API
186187
if (failure && this.error)
187188
failure(this.error, this.data);
188189
};

src/jsboot/utils/storage.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,16 @@ jsBoot.pack('jsBoot.utils', function(api) {
215215
},
216216

217217
write: function(key, data, callback) {
218-
console.warn('jey writte!');
218+
console.warn('jey writte!', key, data, callback);
219219
key = prefix + '_' + (key || '');
220220
try {
221221
store.setItem(key, json.stringify(data));
222-
setTimeout(callback, 1, true);
222+
if(callback)
223+
setTimeout(callback, 1, true);
223224
}catch (e) {
224225
store.removeItem(key);
225-
setTimeout(callback, 1, false);
226+
if(callback)
227+
setTimeout(callback, 1, false);
226228
throw new api.Error('DATA_CORRUPTION',
227229
'Writing into the dataStore failed. This may be indicative of a possible data corruption.');
228230
}

0 commit comments

Comments
 (0)