@lapxo/bound 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/TARGET.bound +30 -25
- package/dist/cli/owner.js +2 -1
- package/dist/cli/place.js +7 -26
- package/dist/cli/retained-judgment.js +25 -0
- package/dist/fold/admission-history.js +6 -11
- package/dist/fold/bootstrap-anchor.js +28 -0
- package/dist/fold/ceilings.js +13 -0
- package/dist/fold/own.js +7 -5
- package/dist/fold/signers.js +5 -9
- package/dist/host/native/module-syntax.js +8 -4
- package/docs/contracts/readme.publication.json +1 -1
- package/package.json +5 -4
- package/receipts.bound +9703 -9572
- package/samples/engine-place/inputs/closure.json +1 -0
|
@@ -18,12 +18,12 @@ export function moduleImportSyntax(source, coordinate) {
|
|
|
18
18
|
}
|
|
19
19
|
const found = new Set(), unresolved = new Set();
|
|
20
20
|
const literal = stringLiteral;
|
|
21
|
-
const visit = (node, parent, key) => {
|
|
21
|
+
const visit = (node, parent, key, reexportSource = false) => {
|
|
22
22
|
if (!node || typeof node !== 'object')
|
|
23
23
|
return;
|
|
24
24
|
if (Array.isArray(node)) {
|
|
25
25
|
for (const child of node)
|
|
26
|
-
visit(child, parent, key);
|
|
26
|
+
visit(child, parent, key, reexportSource);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
const n = node;
|
|
@@ -32,7 +32,11 @@ export function moduleImportSyntax(source, coordinate) {
|
|
|
32
32
|
if (n['type'] === 'Identifier' && n['name'] === 'require') {
|
|
33
33
|
const direct = parent?.['type'] === 'CallExpression' && key === 'callee';
|
|
34
34
|
const namedProperty = (parent?.['type'] === 'MemberExpression' && key === 'property' && !parent['computed']) || ((parent?.['type'] === 'Property' || parent?.['type'] === 'MethodDefinition') && key === 'key' && !parent['computed'] && !parent['shorthand']);
|
|
35
|
-
|
|
35
|
+
// Declaration names are not loader references. This does not resolve shadowing:
|
|
36
|
+
// references to a binding named require remain conservative, including local calls.
|
|
37
|
+
const declarationName = ((parent?.['type'] === 'ImportSpecifier' || parent?.['type'] === 'ImportDefaultSpecifier' || parent?.['type'] === 'ImportNamespaceSpecifier') && (key === 'imported' || key === 'local')) || (parent?.['type'] === 'FunctionDeclaration' && key === 'id');
|
|
38
|
+
const reexportName = parent?.['type'] === 'ExportSpecifier' && (key === 'exported' || (key === 'local' && reexportSource));
|
|
39
|
+
if (!direct && !namedProperty && !declarationName && !reexportName)
|
|
36
40
|
unresolved.add('require reference at ' + String(n['start']));
|
|
37
41
|
}
|
|
38
42
|
let specifier;
|
|
@@ -52,7 +56,7 @@ export function moduleImportSyntax(source, coordinate) {
|
|
|
52
56
|
if (specifier !== undefined)
|
|
53
57
|
found.add(specifier);
|
|
54
58
|
for (const [childKey, child] of Object.entries(n))
|
|
55
|
-
visit(child, n, childKey);
|
|
59
|
+
visit(child, n, childKey, n['type'] === 'ExportNamedDeclaration' ? n['source'] !== null && n['source'] !== undefined : reexportSource);
|
|
56
60
|
};
|
|
57
61
|
visit(tree);
|
|
58
62
|
return { imports: [...found], unresolved: [...unresolved] };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lapxo/bound",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Read the bounds you already wrote, fold them, and name the contradictions.",
|
|
6
6
|
"main": "dist/cli/verb.js",
|
|
@@ -162,13 +162,14 @@
|
|
|
162
162
|
"docs/contracts/readme.publication.json",
|
|
163
163
|
"samples/readme/yes.json",
|
|
164
164
|
"samples/readme/no.json",
|
|
165
|
-
"vectors/native/readme.vector.json"
|
|
165
|
+
"vectors/native/readme.vector.json",
|
|
166
|
+
"samples/engine-place/inputs/closure.json"
|
|
166
167
|
],
|
|
167
168
|
"author": "Lapxo",
|
|
168
169
|
"license": "MIT",
|
|
169
170
|
"dependencies": {
|
|
170
|
-
"@lapxo/obligations": "0.3
|
|
171
|
-
"@lapxo/topos": "^0.2.
|
|
171
|
+
"@lapxo/obligations": "0.4.3",
|
|
172
|
+
"@lapxo/topos": "^0.2.1",
|
|
172
173
|
"acorn": "8.19.0"
|
|
173
174
|
},
|
|
174
175
|
"devDependencies": {
|