Skip to content

Commit 0984e4a

Browse files
leeyehkillme2008
authored andcommitted
[fix] Error with new AV.Role().
1 parent fc28cc3 commit 0984e4a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/role.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ module.exports = function(AV) {
3030
if (_.isString(name)) {
3131
AV.Object.prototype.constructor.call(this, null, null);
3232
this.setName(name);
33+
} else {
34+
AV.Object.prototype.constructor.call(this, name, acl);
3335
}
3436
if (acl === undefined) {
3537
var defaultAcl = new AV.ACL();

test/role.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,10 @@ describe("Role", function() {
2020
new AV.Role('foo', {});
2121
}).to.throwError();
2222
});
23+
it('no argument', function() {
24+
expect(function() {
25+
new AV.Role();
26+
}).not.to.throwError();
27+
});
2328
});
2429
});

0 commit comments

Comments
 (0)