diff --git a/transcrypt/modules/org/transcrypt/compiler.py b/transcrypt/modules/org/transcrypt/compiler.py index 05dff4f1..982ffd12 100644 --- a/transcrypt/modules/org/transcrypt/compiler.py +++ b/transcrypt/modules/org/transcrypt/compiler.py @@ -1020,7 +1020,7 @@ def visit_arguments (self, node): # Visited for def's, not for calls self.emit ('if (typeof {0} == \'undefined\' || ({0} != null && {0}.hasOwnProperty ("__kwargtrans__"))) {{;\n', self.filterId (arg.arg)) self.indent () - self.emit ('var {} = ', self.filterId (arg.arg)) + self.emit ('{} = ', self.filterId (arg.arg)) self.visit (expr) self.emit (';\n') self.dedent () @@ -1161,6 +1161,8 @@ def emitPathIndices (): self.emit ('{}.'.format ('.'.join ([scope.node.name for scope in self.getAdjacentClassScopes ()]))) # The target is a class attribute elif target.id in self.getScope () .nonlocals: pass + elif (fnscope := self.getScope(ast.FunctionDef, ast.AsyncFunctionDef)) and target.id in [a.arg for a in fnscope.node.args.args]: + pass else: if type (self.getScope () .node) == ast.Module: # Redundant but regular if hasattr (node, 'parentNode') and type (node.parentNode) == ast.Module and not target.id in self.allOwnNames: