Ticket #114 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

parser: 'let' expressions can't be used as arguments to function call (several problems)

Reported by: lth Assigned to: jeffdyer
Type: defect Priority: major
Milestone: Component: RefImpl
Version: 4 Keywords:
Cc:

Description

Consider f(let (x = 10) new Object), which is valid code. This fails in various ways:

>> f(let (x = 10) new Object)
**ERROR** ParseError: unknown token in argumentList
>> f((let (x = 10) new Object))
[object Object]
>> f(let (x = 10) (new Object))
**ERROR** EvalError: uncaught exception:
  ReferenceError: unresolved lexical reference
  {multiname: [ns public '']::let
              [ns internal '']::let
              [ns intrinsic]::let }

Attachments

Change History

Changed 1 year ago by lth

  • summary changed from 'let' expressions can't be used as arguments to function call (several problems) to parser: 'let' expressions can't be used as arguments to function call (several problems)

Changed 1 year ago by lth

See also #144.

Same problem with function expressions:

[1,2,3].map(function (x) x*2)

**ERROR** ParseError?: unknown body form in anonymous function expression

[1,2,3].map((function (x) x*2))

2,4,6

Changed 1 year ago by graydon

  • status changed from new to closed
  • resolution set to fixed

Appears fixed in recent revs, not sure which.

Note: See TracTickets for help on using tickets.