Ticket #158 (closed defect: duplicate)

Opened 1 year ago

Last modified 1 year ago

'let function' does not work

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

Description

My intuitive understanding of let function is that the scoping here would work out correctly, but the i in the body of gumbo is not the i in the surrounding block.

>> function zappa() {
     let i=0;
     let function gumbo() { return i };
     return gumbo
   }
>> x = zappa()
[function Function]
>> x()
[stack] [gumbo()]
**ERROR** EvalError: uncaught exception:
  ReferenceError: unresolved lexical reference
  {multiname: [ns public '']::i
              [ns internal '']::i
              [ns intrinsic]::i }

Attachments

Change History

Changed 1 year ago by graydon

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

Dupe of #290, fixed in rev c71b4b5...

Note: See TracTickets for help on using tickets.