@@ -25,8 +25,11 @@ const ApiSubsetOfBuffer = harden({ from: Buffer.from });
25
25
26
26
const options = {
27
27
policy : {
28
+ defaultAttenuator :
29
+ '@endo/compartment-mapper-demo-lavamoat-style-attenuator' ,
28
30
entry : {
29
- globals : 'any' ,
31
+ globals : [ 'root' ] ,
32
+ noGlobalFreeze : true ,
30
33
packages : 'any' ,
31
34
builtins : {
32
35
fs : {
@@ -36,10 +39,13 @@ const options = {
36
39
} ,
37
40
} ,
38
41
resources : {
39
- '@endo/compartment-mapper-demo-policy-attenuator1' : {
40
- globals : {
41
- console : true ,
42
- } ,
42
+ '@endo/compartment-mapper-demo-polyfill1' : {
43
+ globals : [
44
+ {
45
+ console : true ,
46
+ answerPolyfill : 'write' ,
47
+ } ,
48
+ ] ,
43
49
} ,
44
50
dotenv : {
45
51
builtins : {
@@ -51,8 +57,9 @@ const options = {
51
57
path : true ,
52
58
} ,
53
59
globals : {
54
- console : true ,
55
- process : true ,
60
+ // one attenuator implementation can be used for builtins and globals
61
+ attenuate : '@endo/compartment-mapper-demo-policy-attenuator1' ,
62
+ params : [ 'console' , 'process' ] ,
56
63
} ,
57
64
} ,
58
65
entropoetry : {
@@ -72,8 +79,16 @@ const options = {
72
79
builtins : {
73
80
buffer : true ,
74
81
} ,
82
+ globals : 'any' ,
83
+ } ,
84
+ '@endo/compartment-mapper-demo-policy-attenuator1' : {
75
85
globals : {
76
- Buffer : true ,
86
+ console : true ,
87
+ } ,
88
+ } ,
89
+ '@endo/compartment-mapper-demo-lavamoat-style-attenuator' : {
90
+ globals : {
91
+ console : true ,
77
92
} ,
78
93
} ,
79
94
} ,
@@ -105,19 +120,20 @@ console.log('\n\n________________________________________________ Location\n');
105
120
106
121
console . log ( '\n\n________________________________________________ Archive\n' ) ;
107
122
{
123
+ console . log ( '>----------start -> makeArchive' ) ;
108
124
const archive = await makeArchive ( readPower , entrypointPath , {
109
125
modules : options . modules ,
110
126
policy : options . policy ,
111
127
} ) ;
112
- console . log ( '>----------makeArchive' ) ;
128
+ console . log ( '>----------makeArchive -> parseArchive ' ) ;
113
129
const application = await parseArchive ( archive , '<unknown>' , {
114
130
modules : options . modules ,
115
131
} ) ;
116
- console . log ( '>----------parseArchive' ) ;
132
+ console . log ( '>----------parseArchive -> import ' ) ;
117
133
const { namespace } = await application . import ( {
118
134
globals : options . globals ,
119
135
modules : options . modules ,
120
136
} ) ;
121
- console . log ( '>----------import' ) ;
137
+ console . log ( '>----------import -> end ' ) ;
122
138
console . log ( 2 , namespace . poem ) ;
123
139
}
0 commit comments