feat(transpiler): add support for named params to new expressions

This commit is contained in:
vsavkin
2014-10-10 11:50:50 -04:00
parent b71cd9f380
commit ee1e54cf0a
2 changed files with 27 additions and 1 deletions

View File

@ -4,6 +4,11 @@ function sum(a, b) {
return a + b;
}
class ConstructorWithNamedParams {
constructor(a, {b=1, c=2}) {
this.sum = a + b + c;
}
}
export function main() {
describe('functions', function() {
@ -35,6 +40,11 @@ export function main() {
expect(f({a: 10})).toBe(12);
expect(f()).toBe(3);
});
it("should support new expressions", function () {
var obj = new ConstructorWithNamedParams(100, {b:10});
expect(obj.sum).toEqual(112);
});
});
describe("optional params", function () {