-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Description
I am using sucrase to transpile some jest tests and came across a (typescript) file containing a function invocation followed by an export declaration.
Since the export declaration is wrapped into parens during transpilation, it seems the resulting code created a higher order function as it tries to call the result of the invocation with the wrapped export (as there are no semicolons).
const fn = () => ({ key: { nested: 1 } })
const data = fn()
export const { nested } = data.keyresults in
"use strict";Object.defineProperty(exports, "__esModule", {value: true});const fn = () => ({ key: { nested: 1 } })
const data = fn()
( { nested: exports.nested } = data.key)which would lead to const data = fn()(({ nested: exports.nested } = data.key)) and fail for a couple of reasons.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels