-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(import-bundle): Support endoScript #2398
Conversation
1de37c8
to
6c80a47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo the two questions
packages/import-bundle/src/index.js
Outdated
const result = compartment.evaluate(source); | ||
if (moduleFormat === 'endoScript') { | ||
// The completion value of an 'endoScript' is the namespace. | ||
// This format does curry the filePrefix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/does/does not/ ? or did you mean the format holds the filePrefix internally somehow?
inescapableGlobalValue: 42, | ||
}, | ||
}); | ||
t.is(ns.default, 42); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really part of this PR, but should these tests exercise the "inescapability" of inescapableGlobalProperties
? Or did we decide that only the lexical-scope additions needed to be inescapable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like transforms being inescapable might be important too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test fixture is a module that runs in a Compartment and creates a child Compartment without options. So, all of these are verifying inescapability at least one level down.
export default new Compartment().evaluate('inescapableGlobalValue');
6c80a47
to
029330f
Compare
Description
Adds support for
endoScript
to theimportBundle
runtime.Security Considerations
None.
Scaling Considerations
None.
Documentation Considerations
This change makes safe the assumption that all bundles produced by
bundleSource
can be consumed byimportBundle
.Testing Considerations
Unit tests included.
Compatibility Considerations
None.
Upgrade Considerations
None.