Skip to content

bundleSource doesn't correctly handle aliased exports #2981

@mhofman

Description

@mhofman

Describe the bug

When importing an aliased export, it seems that bundleSource, at least in the nestedEvaluate format, fails to correctly bind the import.

Steps to reproduce

See marshal-failure.test.js from #2980

Expected behavior

Correct import semantics for bundled modules

Additional context

Originally encountered when syncing endo in agoric-sdk in Agoric/agoric-sdk#12065

Screenshots

  TypeError: X is not a function
    at encodeErrorCommon (marshal/src/marshal.js:127:29)
    at encodeErrorToSmallcaps (marshal/src/marshal.js:210:25)
    at encodeToSmallcaps (marshal/src/encodeToSmallcaps.js:288:9)
    at toCapData (marshal/src/marshal.js:221:23)
    at eval (endo/marshal.js:9:13)
    at eval (endo/marshal.js:12:3)
    at sourceUrlPrefix.sourceUrlPrefix (eval at <anonymous> (eval at makeEvaluate (packages/ses/src/make-evaluate.js:92:27)), <anonymous>:1058:34)
    at eval (eval at <anonymous> (eval at makeEvaluate (packages/ses/src/make-evaluate.js:92:27)), <anonymous>:1162:4)
    at packages/bundle-source/test/marshal-failure.test.js:21:15

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions