mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fix "export" squashing variable declarations
Exports that referenced variables assigned in the module would prevent the referenced variables from being declared, resulting in ReferenceErrors at run time. Fixes #4394.
This commit is contained in:
@@ -44,9 +44,9 @@ function object that has a name filled in, or bottoms out.
|
||||
Look up a variable name in lexical scope, and declare it if it does not
|
||||
already exist.
|
||||
|
||||
find: (name) ->
|
||||
find: (name, type = 'var') ->
|
||||
return yes if @check name
|
||||
@add name, 'var'
|
||||
@add name, type
|
||||
no
|
||||
|
||||
Reserve a variable name as originating from a function parameter for this
|
||||
@@ -116,4 +116,3 @@ of this scope.
|
||||
|
||||
assignedVariables: ->
|
||||
"#{v.name} = #{v.type.value}" for v in @variables when v.type.assigned
|
||||
|
||||
|
||||
Reference in New Issue
Block a user