-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
a={}
a.b=(cb)->
console.log this
try
console.log this
this.b cont()
catch err
console.error err
a.b()the output code is
(function () {
var a;
a = {};
a.b = function (cb) {
var err;
console.log(this);
(function (_$cont) {
try {
console.log(this);
return this.b(function (arguments) {
try {
_$cont();
} catch (_$err) {
_$cont(_$err);
}
}.bind(this, arguments));
} catch (_$err) {
_$cont(_$err);
}
}(function (_error) {
if (_error !== undefined) {
err = _error;
return console.error(err);
}
}));
};
a.b();
}.call(this));
/* Generated by Continuation.js v0.1.7 */Apparently, this get lost in the structure
(function (_$cont) {
//...
})(function (_error) {
})Metadata
Metadata
Assignees
Labels
No labels