Description
Generator expressions passed directly to method calls like .join() are not being converted to proper JavaScript syntax.
Python Input
result = fieldsep.join(repr(name) for name in names)
total = sum(x * 2 for x in values)
any_null = any(item is None for item in items)
Current Output (v1.3.3)
let result = fieldsep.join(repr(name) for name in names) // ❌ INVALID!
let total = sum(x * 2 for x in values) // ❌ INVALID!
let any_null = any(item is None for item in items) // ❌ INVALID!
Expected Output
const result = fieldsep.join(names.map(name => repr(name)))
const total = sum(values.map(x => x * 2))
const any_null = any(items.map(item => item === null))
Or with IIFE generators (consistent with standalone generators):
const result = fieldsep.join((function*() { for (const name of names) yield repr(name) })())
Note
Standalone generator expressions ARE correctly converted to IIFE generators:
gen = (x for x in items) # Works! → (function*() { ... })()
But when passed directly to a method call, they're not converted.
Affected Files
Found ~124 occurrences in NumPy migration.
Priority
🔴 Critical - Causes ~400 errors
Description
Generator expressions passed directly to method calls like
.join()are not being converted to proper JavaScript syntax.Python Input
Current Output (v1.3.3)
Expected Output
Or with IIFE generators (consistent with standalone generators):
Note
Standalone generator expressions ARE correctly converted to IIFE generators:
But when passed directly to a method call, they're not converted.
Affected Files
Found ~124 occurrences in NumPy migration.
Priority
🔴 Critical - Causes ~400 errors