feat(export-star): enable export * from 'foo'
Do these in order after all other exports have enacted, thereby
never overriding a prior export.
MODIFY
package-lock.json
package-lock.json
"@agoric/transform-eventual-send": "^1.0.3",
"@babel/generator": "^7.6.4",
"esm": "^3.2.5"
- },
- "dependencies": {
- "@babel/generator": {
- "version": "7.7.2",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz",
- "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==",
- "dev": true,
- "requires": {
- "@babel/types": "^7.7.2",
- "jsesc": "^2.5.1",
- "lodash": "^4.17.13",
- "source-map": "^0.5.0"
- }
- },
- "@babel/types": {
- "version": "7.7.2",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz",
- "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==",
- "dev": true,
- "requires": {
- "esutils": "^2.0.2",
- "lodash": "^4.17.13",
- "to-fast-properties": "^2.0.0"
- }
- }
}
},
"@agoric/evaluate": {
}
},
"@agoric/transform-module": {
- "version": "0.1.8",
- "resolved": "https://registry.npmjs.org/@agoric/transform-module/-/transform-module-0.1.8.tgz",
- "integrity": "sha512-fF1IafoXZ+L7EfRJpTNdwgl+e8gdx/ER1BPNt9j6sBT8lSBaLpNXabeaJ0/nrSSA0vpFkHnSiS5iCF/kWjUjGQ==",
+ "version": "0.1.9",
+ "resolved": "https://registry.npmjs.org/@agoric/transform-module/-/transform-module-0.1.9.tgz",
+ "integrity": "sha512-lQuLlEIw92yMQMTtKTlpUCeJP64k7LZhgW9GdqlnkvvJ1EnijhbfdGf1KoTqVdJI9qQYEWKs3p7TOXu1kET9jg==",
"dev": true,
"requires": {
"@agoric/evaluate": "^2.1.3",
- "@babel/core": "^7.5.5",
+ "@babel/core": "^7.7.2",
"esm": "^3.2.5",
"rollup": "^1.17.0",
"rollup-plugin-node-resolve": "^5.2.0"
}
},
"@babel/core": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.6.0.tgz",
- "integrity": "sha512-FuRhDRtsd6IptKpHXAa+4WPZYY2ZzgowkbLBecEDDSje1X/apG7jQM33or3NdOmjXBKWGOg4JmSiRfUfuTtHXw==",
+ "version": "7.7.2",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.7.2.tgz",
+ "integrity": "sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.5.5",
- "@babel/generator": "^7.6.0",
- "@babel/helpers": "^7.6.0",
- "@babel/parser": "^7.6.0",
- "@babel/template": "^7.6.0",
- "@babel/traverse": "^7.6.0",
- "@babel/types": "^7.6.0",
- "convert-source-map": "^1.1.0",
+ "@babel/generator": "^7.7.2",
+ "@babel/helpers": "^7.7.0",
+ "@babel/parser": "^7.7.2",
+ "@babel/template": "^7.7.0",
+ "@babel/traverse": "^7.7.2",
+ "@babel/types": "^7.7.2",
+ "convert-source-map": "^1.7.0",
"debug": "^4.1.0",
"json5": "^2.1.0",
"lodash": "^4.17.13",
},
"dependencies": {
"@babel/parser": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.0.tgz",
- "integrity": "sha512-+o2q111WEx4srBs7L9eJmcwi655eD8sXniLqMB93TBK9GrNzGrxDWSjiqz2hLU0Ha8MTXFIP0yd9fNdP+m43ZQ==",
+ "version": "7.7.3",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz",
+ "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==",
"dev": true
}
}
},
"@babel/generator": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.0.tgz",
- "integrity": "sha512-Ms8Mo7YBdMMn1BYuNtKuP/z0TgEIhbcyB8HVR6PPNYp4P61lMsABiS4A3VG1qznjXVCf3r+fVHhm4efTYVsySA==",
+ "version": "7.7.2",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.2.tgz",
+ "integrity": "sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ==",
"dev": true,
"requires": {
- "@babel/types": "^7.6.0",
+ "@babel/types": "^7.7.2",
"jsesc": "^2.5.1",
"lodash": "^4.17.13",
- "source-map": "^0.5.0",
- "trim-right": "^1.0.1"
+ "source-map": "^0.5.0"
}
},
"@babel/helper-function-name": {
- "version": "7.1.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz",
- "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==",
+ "version": "7.7.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz",
+ "integrity": "sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q==",
"dev": true,
"requires": {
- "@babel/helper-get-function-arity": "^7.0.0",
- "@babel/template": "^7.1.0",
- "@babel/types": "^7.0.0"
+ "@babel/helper-get-function-arity": "^7.7.0",
+ "@babel/template": "^7.7.0",
+ "@babel/types": "^7.7.0"
}
},
"@babel/helper-get-function-arity": {
- "version": "7.0.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz",
- "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==",
+ "version": "7.7.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz",
+ "integrity": "sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw==",
"dev": true,
"requires": {
- "@babel/types": "^7.0.0"
+ "@babel/types": "^7.7.0"
}
},
"@babel/helper-split-export-declaration": {
- "version": "7.4.4",
- "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz",
- "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==",
+ "version": "7.7.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz",
+ "integrity": "sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA==",
"dev": true,
"requires": {
- "@babel/types": "^7.4.4"
+ "@babel/types": "^7.7.0"
}
},
"@babel/helpers": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.0.tgz",
- "integrity": "sha512-W9kao7OBleOjfXtFGgArGRX6eCP0UEcA2ZWEWNkJdRZnHhW4eEbeswbG3EwaRsnQUAEGWYgMq1HsIXuNNNy2eQ==",
+ "version": "7.7.0",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.7.0.tgz",
+ "integrity": "sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g==",
"dev": true,
"requires": {
- "@babel/template": "^7.6.0",
- "@babel/traverse": "^7.6.0",
- "@babel/types": "^7.6.0"
+ "@babel/template": "^7.7.0",
+ "@babel/traverse": "^7.7.0",
+ "@babel/types": "^7.7.0"
}
},
"@babel/highlight": {
}
},
"@babel/template": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz",
- "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==",
+ "version": "7.7.0",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.0.tgz",
+ "integrity": "sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
- "@babel/parser": "^7.6.0",
- "@babel/types": "^7.6.0"
+ "@babel/parser": "^7.7.0",
+ "@babel/types": "^7.7.0"
},
"dependencies": {
"@babel/parser": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.0.tgz",
- "integrity": "sha512-+o2q111WEx4srBs7L9eJmcwi655eD8sXniLqMB93TBK9GrNzGrxDWSjiqz2hLU0Ha8MTXFIP0yd9fNdP+m43ZQ==",
+ "version": "7.7.3",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz",
+ "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==",
"dev": true
}
}
},
"@babel/traverse": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.0.tgz",
- "integrity": "sha512-93t52SaOBgml/xY74lsmt7xOR4ufYvhb5c5qiM6lu4J/dWGMAfAh6eKw4PjLes6DI6nQgearoxnFJk60YchpvQ==",
+ "version": "7.7.2",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.2.tgz",
+ "integrity": "sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.5.5",
- "@babel/generator": "^7.6.0",
- "@babel/helper-function-name": "^7.1.0",
- "@babel/helper-split-export-declaration": "^7.4.4",
- "@babel/parser": "^7.6.0",
- "@babel/types": "^7.6.0",
+ "@babel/generator": "^7.7.2",
+ "@babel/helper-function-name": "^7.7.0",
+ "@babel/helper-split-export-declaration": "^7.7.0",
+ "@babel/parser": "^7.7.2",
+ "@babel/types": "^7.7.2",
"debug": "^4.1.0",
"globals": "^11.1.0",
"lodash": "^4.17.13"
},
"dependencies": {
"@babel/parser": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.0.tgz",
- "integrity": "sha512-+o2q111WEx4srBs7L9eJmcwi655eD8sXniLqMB93TBK9GrNzGrxDWSjiqz2hLU0Ha8MTXFIP0yd9fNdP+m43ZQ==",
+ "version": "7.7.3",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.3.tgz",
+ "integrity": "sha512-bqv+iCo9i+uLVbI0ILzKkvMorqxouI+GbV13ivcARXn9NNEabi2IEz912IgNpT/60BNXac5dgcfjb94NjsF33A==",
"dev": true
}
}
},
"@babel/types": {
- "version": "7.6.1",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.1.tgz",
- "integrity": "sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g==",
+ "version": "7.7.2",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.2.tgz",
+ "integrity": "sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA==",
"dev": true,
"requires": {
"esutils": "^2.0.2",
"dev": true
},
"@types/node": {
- "version": "12.12.8",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.8.tgz",
- "integrity": "sha512-XLla8N+iyfjvsa0KKV+BP/iGSoTmwxsu5Ci5sM33z9TjohF72DEz95iNvD6pPmemvbQgxAv/909G73gUn8QR7w==",
+ "version": "12.12.9",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.9.tgz",
+ "integrity": "sha512-kV3w4KeLsRBW+O2rKhktBwENNJuqAUQHS3kf4ia2wIaF/MN6U7ANgTsx7tGremcA0Pk3Yh0Hl0iKiLPuBdIgmw==",
"dev": true
},
"@types/resolve": {
"dev": true
},
"convert-source-map": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz",
- "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==",
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz",
+ "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==",
"dev": true,
"requires": {
"safe-buffer": "~5.1.1"
"dev": true
},
"json5": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz",
- "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==",
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz",
+ "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
},
"rollup": {
- "version": "1.27.0",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.0.tgz",
- "integrity": "sha512-yaMna4MJ8LLEHhHl1ilgHakylf0LKeQctDxhngZLQ+W57GnXa5vtH7XKaK8zlAhNEhlWiH5YFVFt+QCDPUmNkw==",
+ "version": "1.27.2",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.27.2.tgz",
+ "integrity": "sha512-sD3iyd0zlvgK1S3MmICi6F/Y+R/QWY5XxzsTGN4pAd+nCasDUizmAhgq2hdh1t2eLux974NHU2TW41fhuGPv+Q==",
"dev": true,
"requires": {
"@types/estree": "*",
"integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=",
"dev": true
},
- "trim-right": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
- "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
- "dev": true
- },
"tslib": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz",

MODIFY
package.json
package.json
"lint-check-jessie": "eslint -c '.eslintrc-jessie.js' '**/*.{js,jsx}'"
},
"devDependencies": {
- "@agoric/transform-module": "^0.1.8",
- "@babel/core": "^7.6.0",
+ "@agoric/transform-module": "^0.1.9",
+ "@babel/core": "^7.7.2",
"eslint": "^6.1.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-jessie": "0.0.3",

MODIFY
src/moduleInstance.js
src/moduleInstance.js
@@ -197,7 +197,7 @@ export function makeModuleInstance(
// The updateRecord must conform to linkageRecord.imports
// updateRecord = Map<specifier, importUpdaters>
// importUpdaters = Map<importName, [update(newValue)*]>
- async function imports(updateRecord) {
+ async function imports(updateRecord, exportAlls) {
// By the time imports is called, the importNS should already be
// initialized with module instances that satisfy
// linkageRecord.imports.
@@ -221,6 +221,31 @@ export function makeModuleInstance(
ps.push(p);
}
await Promise.all(ps);
+ // Execute the export * from 'mod' clauses in order.
+ for (const specifier of exportAlls) {
+ const moduleId = linkageRecord.moduleIds[specifier];
+ const instance = importNS.get(moduleId);
+ await instance
+ .initialize()
+ .then(() => {
+ const { notifiers: modNotifiers } = instance;
+ for (const [importName, notify] of Object.entries(modNotifiers)) {
+ if (!notifiers[importName]) {
+ notifiers[importName] = notify;
+
+ // exported live binding state
+ let value;
+ notify(v => value = v);
+ defProp(moduleNS, importName, {
+ get() { return value },
+ set: undefined,
+ enumerable: true,
+ configurable: false,
+ });
+ }
+ }
+ });
+ }
}
const endowments = create(null, {

MODIFY
test/moddir/index.js
test/moddir/index.js
@@ -29,4 +29,4 @@ export { xx };
export { w as vv }; // exports the w we imported. Therefore assumed live.
export { f } from './foo';
export { g as h } from './foo';
-// export * from 'foo';
+export * from './foo';

MODIFY
test/test-link.js
test/test-link.js
@@ -18,7 +18,7 @@ with (arguments[1]) {
functorSource: `\
${async ({ liveVar, imports }) => {
let def;
- await imports(new Map([['./def', new Map([['def', [$ha => (def = $ha)]]])]]));
+ await imports(new Map([['./def', new Map([['def', [$ha => (def = $ha)]]])]]), []);
liveVar.abc(def);
}}`,
@@ -33,7 +33,7 @@ ${async ({ liveVar, imports }) => {
'https://www.example.com/foo/def',
{
functorSource: `\
-async ({ imports, liveVar }) => { await imports(new Map()); liveVar.lo(456); lo ++; }`,
+async ({ imports, liveVar }) => { await imports(new Map(), []); liveVar.lo(456); lo ++; }`,
imports: {},
fixedExportMap: {},
liveExportMap: { def: ['lo', true] },

MODIFY
test/test-moddir.js
test/test-moddir.js
@@ -47,6 +47,7 @@ with (arguments[1]) {
xx: 33,
vv: 'xChanged',
f: 'f',
+ g: 'gChanged',
h: 'gChanged',
},
`importer works`,

feat(export-star): enable export * from 'foo'

Do these in order after all other exports have enacted, thereby
never overriding a prior export.