Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Promises.js: mooshell tweaks

  • Loading branch information...
commit 796cb8f4de25eadd6dbfec766281220f8e329722 1 parent 3f78aae
@swannodette swannodette authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 Promises.js
View
10 Promises.js
@@ -138,7 +138,15 @@ var Promise = new Class({
this.__req = req;
req.addEvent('onSuccess', function(r) {
var json = ($type(r) == 'object') ? r : ((!req.options.bare) ? JSON.decode(r) : r),
- v = (Promise.deref !== null && json[Promise.deref] !== null && json[Promise.deref] !== undefined) ? json[Promise.deref] : json;
+ v;
+ if(Promise.deref !== null) {
+ var temp = Function.get.apply(null, [json].concat(Promise.deref.split(".")));
+ if(temp !== null && temp !== undefined) {
+ v = temp;
+ }
+ } else {
+ v = json;
+ }
this.deliver(this.applyOps(v));
}.bind(this));
req.addEvent('onFailure', function(responseText) {
Please sign in to comment.
Something went wrong with that request. Please try again.