Created
July 10, 2012 12:09
-
-
Save Alan01252/3082925 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var test = { | |
idAccount:121, | |
idTier:1, | |
update:function(req,res){ | |
if(typeof(this.idAccount) != 'undefined') { | |
this.findTier(req,res,function(doc){ | |
req.body.tier = doc.tier; | |
console.log("1"); | |
}); | |
} | |
console.log("2"); | |
this.updateTier(req,res); | |
}, | |
updateTier:function(req,res){ | |
this.idTier = req.body.tier; | |
}, | |
findTier:function(req,res,callback) { | |
console.log("Finding tier"); | |
for(var i=0; i < 1000000000; i++){ | |
} | |
callback({tier:9999}); | |
} | |
} | |
var req = {body:{tier:0}}; | |
var res = {}; | |
test.update(req,res); | |
console.log("Tier is "+test.idTier); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment