Created
December 30, 2014 12:08
-
-
Save MylesBorins/c26750a1d414a9d2ddeb to your computer and use it in GitHub Desktop.
Ruhroh Closure
This file contains hidden or 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
var stub = require('./stub'); | |
stub.home().woops().maybe(); |
This file contains hidden or 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
'use strict'; | |
var ctx = { | |
payload: 'as expected' | |
}; | |
exports.home = function () { | |
ctx.error = 'OMG AN ERROR'; | |
ctx.sensitiveData = ['oh', 'shit', 'son']; | |
return exports; | |
}; | |
exports.woops = function () { | |
console.log(ctx.error); | |
if (ctx.sensitiveData) { | |
ctx.payload = 'I\'m in ur tronz'; | |
} | |
return exports; | |
}; | |
exports.maybe = function () { | |
console.log(ctx.payload); | |
return exports; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment