Skip to content

transpiler: handle named parameters #38

@vsavkin

Description

@vsavkin
 it('should compile named params when the last argument is a map', function() {
    function f(a, {b, c}) {return a + b + c;}

    expect(f(1, {b: 2, c: 3})).toBe(6);
  });

  it('should compile to a map when keys are quoted', function() {
    function f(m) {return m["a"] + m["b"];}

    expect(f({"a": 1, "b": 2})).toBe(3);
  });

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions