support nested arrow functions - fixes #60
This commit is contained in:
13
test/fixtures/syntax/arrow-functions/nested/actual.js
vendored
Normal file
13
test/fixtures/syntax/arrow-functions/nested/actual.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
init() {
|
||||
return new Promise((resolve, reject) => {
|
||||
MongoClient.connect(config.mongodb, (err, db) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
this.db = db;
|
||||
resolve(this);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
14
test/fixtures/syntax/arrow-functions/nested/expected.js
vendored
Normal file
14
test/fixtures/syntax/arrow-functions/nested/expected.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
init: function() {
|
||||
var _this = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
MongoClient.connect(config.mongodb, function(err, db) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
_this.db = db;
|
||||
resolve(_this);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user