@pulumi/pulumi 3.163.0-alpha.xc33c68d → 3.163.0-alpha.xe7c1e4f

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.
Files changed (70) hide show
  1. package/automation/cmd.js +92 -111
  2. package/automation/cmd.js.map +1 -1
  3. package/automation/localWorkspace.js +383 -476
  4. package/automation/localWorkspace.js.map +1 -1
  5. package/automation/remoteWorkspace.js +38 -55
  6. package/automation/remoteWorkspace.js.map +1 -1
  7. package/automation/server.js +6 -16
  8. package/automation/server.js.map +1 -1
  9. package/automation/stack.js +537 -608
  10. package/automation/stack.js.map +1 -1
  11. package/cmd/dynamic-provider/index.js +204 -235
  12. package/cmd/dynamic-provider/index.js.map +1 -1
  13. package/cmd/run/error.js +3 -3
  14. package/cmd/run/error.js.map +1 -1
  15. package/cmd/run/run.js +322 -336
  16. package/cmd/run/run.js.map +1 -1
  17. package/cmd/run/tracing.js +1 -2
  18. package/cmd/run/tracing.js.map +1 -1
  19. package/cmd/run-plugin/run.js +13 -17
  20. package/cmd/run-plugin/run.js.map +1 -1
  21. package/cmd/run-policy-pack/run.js +12 -16
  22. package/cmd/run-policy-pack/run.js.map +1 -1
  23. package/output.js +61 -78
  24. package/output.js.map +1 -1
  25. package/package.json +1 -1
  26. package/provider/experimental/analyzer.js +43 -46
  27. package/provider/experimental/analyzer.js.map +1 -1
  28. package/provider/experimental/provider.js +22 -36
  29. package/provider/experimental/provider.js.map +1 -1
  30. package/provider/server.js +359 -397
  31. package/provider/server.js.map +1 -1
  32. package/resource.js +29 -41
  33. package/resource.js.map +1 -1
  34. package/runtime/asyncIterableUtil.js +6 -17
  35. package/runtime/asyncIterableUtil.js.map +1 -1
  36. package/runtime/callbacks.js +254 -269
  37. package/runtime/callbacks.js.map +1 -1
  38. package/runtime/closure/codePaths.js +117 -135
  39. package/runtime/closure/codePaths.js.map +1 -1
  40. package/runtime/closure/createClosure.js +807 -871
  41. package/runtime/closure/createClosure.js.map +1 -1
  42. package/runtime/closure/parseFunction.js +2 -3
  43. package/runtime/closure/parseFunction.js.map +1 -1
  44. package/runtime/closure/serializeClosure.js +17 -30
  45. package/runtime/closure/serializeClosure.js.map +1 -1
  46. package/runtime/closure/v8.js +166 -190
  47. package/runtime/closure/v8.js.map +1 -1
  48. package/runtime/closure/v8Hooks.js +19 -34
  49. package/runtime/closure/v8Hooks.js.map +1 -1
  50. package/runtime/dependsOn.js +61 -80
  51. package/runtime/dependsOn.js.map +1 -1
  52. package/runtime/invoke.js +155 -170
  53. package/runtime/invoke.js.map +1 -1
  54. package/runtime/mocks.js +77 -96
  55. package/runtime/mocks.js.map +1 -1
  56. package/runtime/resource.js +238 -252
  57. package/runtime/resource.js.map +1 -1
  58. package/runtime/rpc.js +193 -215
  59. package/runtime/rpc.js.map +1 -1
  60. package/runtime/settings.js +70 -87
  61. package/runtime/settings.js.map +1 -1
  62. package/runtime/stack.js +111 -131
  63. package/runtime/stack.js.map +1 -1
  64. package/stackReference.js +39 -58
  65. package/stackReference.js.map +1 -1
  66. package/tsutils.js +1 -2
  67. package/tsutils.js.map +1 -1
  68. package/utils.js +2 -3
  69. package/utils.js.map +1 -1
  70. package/version.js +1 -1
@@ -12,15 +12,6 @@
12
12
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  // See the License for the specific language governing permissions and
14
14
  // limitations under the License.
15
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
- return new (P || (P = Promise))(function (resolve, reject) {
18
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
- step((generator = generator.apply(thisArg, _arguments || [])).next());
22
- });
23
- };
24
15
  var __importStar = (this && this.__importStar) || function (mod) {
25
16
  if (mod && mod.__esModule) return mod;
26
17
  var result = {};
@@ -48,25 +39,23 @@ const v8Hooks = __importStar(require("./v8Hooks"));
48
39
  *
49
40
  * @internal
50
41
  */
51
- function getFunctionLocationAsync(func) {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- // First, find the runtime's internal id for this function.
54
- const functionId = yield getRuntimeIdForFunctionAsync(func);
55
- // Now, query for the internal properties the runtime sets up for it.
56
- const { internalProperties } = yield runtimeGetPropertiesAsync(functionId, /*ownProperties:*/ false);
57
- // There should normally be an internal property called [[FunctionLocation]]:
58
- // https://chromium.googlesource.com/v8/v8.git/+/3f99afc93c9ba1ba5df19f123b93cc3079893c9b/src/inspector/v8-debugger.cc#793
59
- const functionLocation = internalProperties.find((p) => p.name === "[[FunctionLocation]]");
60
- if (!functionLocation || !functionLocation.value || !functionLocation.value.value) {
61
- return { file: "", line: 0, column: 0 };
62
- }
63
- const value = functionLocation.value.value;
64
- // Map from the scriptId the value has to a file-url.
65
- const file = v8Hooks.getScriptUrl(value.scriptId) || "";
66
- const line = value.lineNumber || 0;
67
- const column = value.columnNumber || 0;
68
- return { file, line, column };
69
- });
42
+ async function getFunctionLocationAsync(func) {
43
+ // First, find the runtime's internal id for this function.
44
+ const functionId = await getRuntimeIdForFunctionAsync(func);
45
+ // Now, query for the internal properties the runtime sets up for it.
46
+ const { internalProperties } = await runtimeGetPropertiesAsync(functionId, /*ownProperties:*/ false);
47
+ // There should normally be an internal property called [[FunctionLocation]]:
48
+ // https://chromium.googlesource.com/v8/v8.git/+/3f99afc93c9ba1ba5df19f123b93cc3079893c9b/src/inspector/v8-debugger.cc#793
49
+ const functionLocation = internalProperties.find((p) => p.name === "[[FunctionLocation]]");
50
+ if (!functionLocation || !functionLocation.value || !functionLocation.value.value) {
51
+ return { file: "", line: 0, column: 0 };
52
+ }
53
+ const value = functionLocation.value.value;
54
+ // Map from the scriptId the value has to a file-url.
55
+ const file = v8Hooks.getScriptUrl(value.scriptId) || "";
56
+ const line = value.lineNumber || 0;
57
+ const column = value.columnNumber || 0;
58
+ return { file, line, column };
70
59
  }
71
60
  exports.getFunctionLocationAsync = getFunctionLocationAsync;
72
61
  /**
@@ -87,47 +76,45 @@ exports.getFunctionLocationAsync = getFunctionLocationAsync;
87
76
  *
88
77
  * @internal
89
78
  */
90
- function lookupCapturedVariableValueAsync(func, freeVariable, throwOnFailure) {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- // First, find the runtime's internal id for this function.
93
- const functionId = yield getRuntimeIdForFunctionAsync(func);
94
- // Now, query for the internal properties the runtime sets up for it.
95
- const { internalProperties } = yield runtimeGetPropertiesAsync(functionId, /*ownProperties:*/ false);
96
- // There should normally be an internal property called [[Scopes]]:
97
- // https://chromium.googlesource.com/v8/v8.git/+/3f99afc93c9ba1ba5df19f123b93cc3079893c9b/src/inspector/v8-debugger.cc#820
98
- const scopes = internalProperties.find((p) => p.name === "[[Scopes]]");
99
- if (!scopes) {
100
- throw new Error("Could not find [[Scopes]] property");
101
- }
102
- if (!scopes.value) {
103
- throw new Error("[[Scopes]] property did not have [value]");
104
- }
105
- if (!scopes.value.objectId) {
106
- throw new Error("[[Scopes]].value have objectId");
107
- }
108
- // This is sneaky, but we can actually map back from the [[Scopes]] object to a real in-memory
109
- // v8 array-like value. Note: this isn't actually a real array. For example, it cannot be
110
- // iterated. Nor can any actual methods be called on it. However, we can directly index into
111
- // it, and we can. Similarly, the 'object' type it optionally points at is not a true JS
112
- // object. So we can't call things like .hasOwnProperty on it. However, the values pointed to
113
- // by 'object' are the real in-memory JS objects we are looking for. So we can find and return
114
- // those successfully to our caller.
115
- const scopesArray = yield getValueForObjectId(scopes.value.objectId);
116
- // scopesArray is ordered from innermost to outermost.
117
- for (let i = 0, n = scopesArray.length; i < n; i++) {
118
- const scope = scopesArray[i];
119
- if (scope.object) {
120
- if (freeVariable in scope.object) {
121
- const val = scope.object[freeVariable];
122
- return val;
123
- }
79
+ async function lookupCapturedVariableValueAsync(func, freeVariable, throwOnFailure) {
80
+ // First, find the runtime's internal id for this function.
81
+ const functionId = await getRuntimeIdForFunctionAsync(func);
82
+ // Now, query for the internal properties the runtime sets up for it.
83
+ const { internalProperties } = await runtimeGetPropertiesAsync(functionId, /*ownProperties:*/ false);
84
+ // There should normally be an internal property called [[Scopes]]:
85
+ // https://chromium.googlesource.com/v8/v8.git/+/3f99afc93c9ba1ba5df19f123b93cc3079893c9b/src/inspector/v8-debugger.cc#820
86
+ const scopes = internalProperties.find((p) => p.name === "[[Scopes]]");
87
+ if (!scopes) {
88
+ throw new Error("Could not find [[Scopes]] property");
89
+ }
90
+ if (!scopes.value) {
91
+ throw new Error("[[Scopes]] property did not have [value]");
92
+ }
93
+ if (!scopes.value.objectId) {
94
+ throw new Error("[[Scopes]].value have objectId");
95
+ }
96
+ // This is sneaky, but we can actually map back from the [[Scopes]] object to a real in-memory
97
+ // v8 array-like value. Note: this isn't actually a real array. For example, it cannot be
98
+ // iterated. Nor can any actual methods be called on it. However, we can directly index into
99
+ // it, and we can. Similarly, the 'object' type it optionally points at is not a true JS
100
+ // object. So we can't call things like .hasOwnProperty on it. However, the values pointed to
101
+ // by 'object' are the real in-memory JS objects we are looking for. So we can find and return
102
+ // those successfully to our caller.
103
+ const scopesArray = await getValueForObjectId(scopes.value.objectId);
104
+ // scopesArray is ordered from innermost to outermost.
105
+ for (let i = 0, n = scopesArray.length; i < n; i++) {
106
+ const scope = scopesArray[i];
107
+ if (scope.object) {
108
+ if (freeVariable in scope.object) {
109
+ const val = scope.object[freeVariable];
110
+ return val;
124
111
  }
125
112
  }
126
- if (throwOnFailure) {
127
- throw new Error("Unexpected missing variable in closure environment: " + freeVariable);
128
- }
129
- return undefined;
130
- });
113
+ }
114
+ if (throwOnFailure) {
115
+ throw new Error("Unexpected missing variable in closure environment: " + freeVariable);
116
+ }
117
+ return undefined;
131
118
  }
132
119
  exports.lookupCapturedVariableValueAsync = lookupCapturedVariableValueAsync;
133
120
  // Isolated singleton context accessible from the inspector.
@@ -140,140 +127,129 @@ function inflightContext() {
140
127
  inflightContextCache = createContext();
141
128
  return inflightContextCache;
142
129
  }
143
- function createContext() {
144
- return __awaiter(this, void 0, void 0, function* () {
145
- const context = {
146
- contextId: 0,
147
- functions: {},
148
- currentFunctionId: 0,
149
- calls: {},
150
- currentCallId: 0,
151
- };
152
- const session = yield v8Hooks.getSessionAsync();
153
- const post = util.promisify(session.post);
154
- // Create own context with known context id and functionsContext as `global`
155
- yield post.call(session, "Runtime.enable");
156
- const contextIdAsync = new Promise((resolve) => {
157
- session.once("Runtime.executionContextCreated", (event) => {
158
- resolve(event.params.context.id);
159
- });
130
+ async function createContext() {
131
+ const context = {
132
+ contextId: 0,
133
+ functions: {},
134
+ currentFunctionId: 0,
135
+ calls: {},
136
+ currentCallId: 0,
137
+ };
138
+ const session = await v8Hooks.getSessionAsync();
139
+ const post = util.promisify(session.post);
140
+ // Create own context with known context id and functionsContext as `global`
141
+ await post.call(session, "Runtime.enable");
142
+ const contextIdAsync = new Promise((resolve) => {
143
+ session.once("Runtime.executionContextCreated", (event) => {
144
+ resolve(event.params.context.id);
160
145
  });
161
- vm.createContext(context);
162
- context.contextId = yield contextIdAsync;
163
- yield post.call(session, "Runtime.disable");
164
- return context;
165
146
  });
147
+ vm.createContext(context);
148
+ context.contextId = await contextIdAsync;
149
+ await post.call(session, "Runtime.disable");
150
+ return context;
166
151
  }
167
- function getRuntimeIdForFunctionAsync(func) {
168
- return __awaiter(this, void 0, void 0, function* () {
169
- // In order to get information about an object, we need to put it in a well known location so
170
- // that we can call Runtime.evaluate and find it. To do this, we use a special map on the
171
- // 'global' object of a vm context only used for this purpose, and map from a unique-id to that
172
- // object. We then call Runtime.evaluate with an expression that then points to that unique-id
173
- // in that global object. The runtime will then find the object and give us back an internal id
174
- // for it. We can then query for information about the object through that internal id.
175
- //
176
- // Note: the reason for the mapping object and the unique-id we create is so that we don't run
177
- // into any issues when being called asynchronously. We don't want to place the object in a
178
- // location that might be overwritten by another call while we're asynchronously waiting for our
179
- // original call to complete.
180
- const session = yield v8Hooks.getSessionAsync();
181
- const post = util.promisify(session.post);
182
- // Place the function in a unique location
183
- const context = yield inflightContext();
184
- const currentFunctionName = "id" + context.currentFunctionId++;
185
- context.functions[currentFunctionName] = func;
186
- const contextId = context.contextId;
187
- const expression = `functions.${currentFunctionName}`;
188
- try {
189
- const retType = yield post.call(session, "Runtime.evaluate", { contextId, expression });
190
- if (retType.exceptionDetails) {
191
- throw new Error(`Error calling "Runtime.evaluate(${expression})" on context ${contextId}: ` +
192
- retType.exceptionDetails.text);
193
- }
194
- const remoteObject = retType.result;
195
- if (remoteObject.type !== "function") {
196
- throw new Error("Remote object was not 'function': " + JSON.stringify(remoteObject));
197
- }
198
- if (!remoteObject.objectId) {
199
- throw new Error("Remote function does not have 'objectId': " + JSON.stringify(remoteObject));
200
- }
201
- return remoteObject.objectId;
152
+ async function getRuntimeIdForFunctionAsync(func) {
153
+ // In order to get information about an object, we need to put it in a well known location so
154
+ // that we can call Runtime.evaluate and find it. To do this, we use a special map on the
155
+ // 'global' object of a vm context only used for this purpose, and map from a unique-id to that
156
+ // object. We then call Runtime.evaluate with an expression that then points to that unique-id
157
+ // in that global object. The runtime will then find the object and give us back an internal id
158
+ // for it. We can then query for information about the object through that internal id.
159
+ //
160
+ // Note: the reason for the mapping object and the unique-id we create is so that we don't run
161
+ // into any issues when being called asynchronously. We don't want to place the object in a
162
+ // location that might be overwritten by another call while we're asynchronously waiting for our
163
+ // original call to complete.
164
+ const session = await v8Hooks.getSessionAsync();
165
+ const post = util.promisify(session.post);
166
+ // Place the function in a unique location
167
+ const context = await inflightContext();
168
+ const currentFunctionName = "id" + context.currentFunctionId++;
169
+ context.functions[currentFunctionName] = func;
170
+ const contextId = context.contextId;
171
+ const expression = `functions.${currentFunctionName}`;
172
+ try {
173
+ const retType = await post.call(session, "Runtime.evaluate", { contextId, expression });
174
+ if (retType.exceptionDetails) {
175
+ throw new Error(`Error calling "Runtime.evaluate(${expression})" on context ${contextId}: ` +
176
+ retType.exceptionDetails.text);
202
177
  }
203
- finally {
204
- delete context.functions[currentFunctionName];
178
+ const remoteObject = retType.result;
179
+ if (remoteObject.type !== "function") {
180
+ throw new Error("Remote object was not 'function': " + JSON.stringify(remoteObject));
205
181
  }
206
- });
207
- }
208
- function runtimeGetPropertiesAsync(objectId, ownProperties) {
209
- return __awaiter(this, void 0, void 0, function* () {
210
- const session = yield v8Hooks.getSessionAsync();
211
- const post = util.promisify(session.post);
212
- // This cast will become unnecessary when we move to TS 3.1.6 or above. In that version they
213
- // support typesafe '.call' calls.
214
- const retType = (yield post.call(session, "Runtime.getProperties", { objectId, ownProperties }));
215
- if (retType.exceptionDetails) {
216
- throw new Error(`Error calling "Runtime.getProperties(${objectId}, ${ownProperties})": ` + retType.exceptionDetails.text);
182
+ if (!remoteObject.objectId) {
183
+ throw new Error("Remote function does not have 'objectId': " + JSON.stringify(remoteObject));
217
184
  }
218
- return { internalProperties: retType.internalProperties || [], properties: retType.result };
219
- });
185
+ return remoteObject.objectId;
186
+ }
187
+ finally {
188
+ delete context.functions[currentFunctionName];
189
+ }
190
+ }
191
+ async function runtimeGetPropertiesAsync(objectId, ownProperties) {
192
+ const session = await v8Hooks.getSessionAsync();
193
+ const post = util.promisify(session.post);
194
+ // This cast will become unnecessary when we move to TS 3.1.6 or above. In that version they
195
+ // support typesafe '.call' calls.
196
+ const retType = (await post.call(session, "Runtime.getProperties", { objectId, ownProperties }));
197
+ if (retType.exceptionDetails) {
198
+ throw new Error(`Error calling "Runtime.getProperties(${objectId}, ${ownProperties})": ` + retType.exceptionDetails.text);
199
+ }
200
+ return { internalProperties: retType.internalProperties || [], properties: retType.result };
220
201
  }
221
- function getValueForObjectId(objectId) {
222
- return __awaiter(this, void 0, void 0, function* () {
223
- // In order to get the raw JS value for the *remote wrapper* of the [[Scopes]] array, we use
224
- // Runtime.callFunctionOn on it passing in a fresh function-declaration. The Node runtime will
225
- // then compile that function, invoking it with the 'real' underlying scopes-array value in
226
- // memory as the bound 'this' value. Inside that function declaration, we can then access
227
- // 'this' and assign it to a unique-id in a well known mapping table we have set up. As above,
228
- // the unique-id is to prevent any issues with multiple in-flight asynchronous calls.
229
- const session = yield v8Hooks.getSessionAsync();
230
- const post = util.promisify(session.post);
231
- const context = yield inflightContext();
232
- // Get an id for an unused location in the global table.
233
- const tableId = "id" + context.currentCallId++;
234
- // Now, ask the runtime to call a fictitious method on the scopes-array object. When it
235
- // does, it will get the actual underlying value for the scopes array and bind it to the
236
- // 'this' value inside the function. Inside the function we then just grab 'this' and
237
- // stash it in our global table. After this completes, we'll then have access to it.
238
- // This cast will become unnecessary when we move to TS 3.1.6 or above. In that version they
239
- // support typesafe '.call' calls.
240
- const retType = yield post.call(session, "Runtime.callFunctionOn", {
241
- objectId,
242
- functionDeclaration: `function () {
202
+ async function getValueForObjectId(objectId) {
203
+ // In order to get the raw JS value for the *remote wrapper* of the [[Scopes]] array, we use
204
+ // Runtime.callFunctionOn on it passing in a fresh function-declaration. The Node runtime will
205
+ // then compile that function, invoking it with the 'real' underlying scopes-array value in
206
+ // memory as the bound 'this' value. Inside that function declaration, we can then access
207
+ // 'this' and assign it to a unique-id in a well known mapping table we have set up. As above,
208
+ // the unique-id is to prevent any issues with multiple in-flight asynchronous calls.
209
+ const session = await v8Hooks.getSessionAsync();
210
+ const post = util.promisify(session.post);
211
+ const context = await inflightContext();
212
+ // Get an id for an unused location in the global table.
213
+ const tableId = "id" + context.currentCallId++;
214
+ // Now, ask the runtime to call a fictitious method on the scopes-array object. When it
215
+ // does, it will get the actual underlying value for the scopes array and bind it to the
216
+ // 'this' value inside the function. Inside the function we then just grab 'this' and
217
+ // stash it in our global table. After this completes, we'll then have access to it.
218
+ // This cast will become unnecessary when we move to TS 3.1.6 or above. In that version they
219
+ // support typesafe '.call' calls.
220
+ const retType = await post.call(session, "Runtime.callFunctionOn", {
221
+ objectId,
222
+ functionDeclaration: `function () {
243
223
  calls["${tableId}"] = this;
244
224
  }`,
245
- });
246
- if (retType.exceptionDetails) {
247
- throw new Error(`Error calling "Runtime.callFunction(${objectId})": ` + retType.exceptionDetails.text);
248
- }
249
- if (!context.calls.hasOwnProperty(tableId)) {
250
- throw new Error(`Value was not stored into table after calling "Runtime.callFunctionOn(${objectId})"`);
251
- }
252
- // Extract value and clear our table entry.
253
- const val = context.calls[tableId];
254
- delete context.calls[tableId];
255
- return val;
256
225
  });
226
+ if (retType.exceptionDetails) {
227
+ throw new Error(`Error calling "Runtime.callFunction(${objectId})": ` + retType.exceptionDetails.text);
228
+ }
229
+ if (!context.calls.hasOwnProperty(tableId)) {
230
+ throw new Error(`Value was not stored into table after calling "Runtime.callFunctionOn(${objectId})"`);
231
+ }
232
+ // Extract value and clear our table entry.
233
+ const val = context.calls[tableId];
234
+ delete context.calls[tableId];
235
+ return val;
257
236
  }
258
- function getBoundFunction(func) {
259
- var _a, _b, _c, _d, _e;
260
- return __awaiter(this, void 0, void 0, function* () {
261
- const functionId = yield getRuntimeIdForFunctionAsync(func);
262
- const { internalProperties } = yield runtimeGetPropertiesAsync(functionId, /*ownProperties:*/ false);
263
- const desc = internalProperties.find((p) => p.name === "[[TargetFunction]]");
264
- const targetFunctionText = (_a = desc === null || desc === void 0 ? void 0 : desc.value) === null || _a === void 0 ? void 0 : _a.description;
265
- if (!targetFunctionText) {
266
- throw new Error("function is not a bound function");
267
- }
268
- const boundThisValue = (_c = (_b = internalProperties.find((p) => p.name === "[[BoundThis]]")) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.value;
269
- const boundArgsObjectId = (_e = (_d = internalProperties.find((p) => p.name === "[[BoundArgs]]")) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.objectId;
270
- let boundArgsValues = [];
271
- if (boundArgsObjectId) {
272
- const { properties } = yield runtimeGetPropertiesAsync(boundArgsObjectId, /*ownProperties:*/ false);
273
- boundArgsValues = properties.filter((p) => p.enumerable).map((p) => { var _a; return (_a = p.value) === null || _a === void 0 ? void 0 : _a.value; });
274
- }
275
- return { targetFunctionText, boundThisValue, boundArgsValues };
276
- });
237
+ async function getBoundFunction(func) {
238
+ const functionId = await getRuntimeIdForFunctionAsync(func);
239
+ const { internalProperties } = await runtimeGetPropertiesAsync(functionId, /*ownProperties:*/ false);
240
+ const desc = internalProperties.find((p) => p.name === "[[TargetFunction]]");
241
+ const targetFunctionText = desc?.value?.description;
242
+ if (!targetFunctionText) {
243
+ throw new Error("function is not a bound function");
244
+ }
245
+ const boundThisValue = internalProperties.find((p) => p.name === "[[BoundThis]]")?.value?.value;
246
+ const boundArgsObjectId = internalProperties.find((p) => p.name === "[[BoundArgs]]")?.value?.objectId;
247
+ let boundArgsValues = [];
248
+ if (boundArgsObjectId) {
249
+ const { properties } = await runtimeGetPropertiesAsync(boundArgsObjectId, /*ownProperties:*/ false);
250
+ boundArgsValues = properties.filter((p) => p.enumerable).map((p) => p.value?.value);
251
+ }
252
+ return { targetFunctionText, boundThisValue, boundArgsValues };
277
253
  }
278
254
  exports.getBoundFunction = getBoundFunction;
279
255
  //# sourceMappingURL=v8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"v8.js","sourceRoot":"","sources":["../../../runtime/closure/v8.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;;;;;;;AAEjC,mGAAmG;AACnG,mGAAmG;AACnG,iGAAiG;AACjG,+BAA+B;AAC/B,EAAE;AACF,mGAAmG;AACnG,2EAA2E;AAC3E,uCAAyB;AACzB,EAAE,CAAC,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;AAGhD,2CAA6B;AAC7B,uCAAyB;AACzB,mDAAqC;AAErC;;;;;;GAMG;AACH,SAAsB,wBAAwB,CAAC,IAAc;;QACzD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AAe,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;KACvF;IAED,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AACnE,CAAC;AAtBD,4CAsBC"}
@@ -12,15 +12,6 @@
12
12
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
  // See the License for the specific language governing permissions and
14
14
  // limitations under the License.
15
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
- return new (P || (P = Promise))(function (resolve, reject) {
18
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
- step((generator = generator.apply(thisArg, _arguments || [])).next());
22
- });
23
- };
24
15
  var __importStar = (this && this.__importStar) || function (mod) {
25
16
  if (mod && mod.__esModule) return mod;
26
17
  var result = {};
@@ -44,24 +35,22 @@ function getSession() {
44
35
  return session;
45
36
  }
46
37
  const scriptIdToUrlMap = new Map();
47
- function createInspectorSessionAsync() {
48
- return __awaiter(this, void 0, void 0, function* () {
49
- // Delay loading 'inspector' as it is not available on early versions of node, so we can't
50
- // require it on the outside.
51
- const inspector = yield Promise.resolve().then(() => __importStar(require("inspector")));
52
- const inspectorSession = new inspector.Session();
53
- inspectorSession.connect();
54
- // Enable debugging support so we can hear about the Debugger.scriptParsed event. We need that
55
- // event to know how to map from scriptId's to file-urls.
56
- yield new Promise((resolve, reject) => {
57
- inspectorSession.post("Debugger.enable", (err, res) => (err ? reject(err) : resolve(res)));
58
- });
59
- inspectorSession.addListener("Debugger.scriptParsed", (event) => {
60
- const { scriptId, url } = event.params;
61
- scriptIdToUrlMap.set(scriptId, url);
62
- });
63
- return inspectorSession;
38
+ async function createInspectorSessionAsync() {
39
+ // Delay loading 'inspector' as it is not available on early versions of node, so we can't
40
+ // require it on the outside.
41
+ const inspector = await Promise.resolve().then(() => __importStar(require("inspector")));
42
+ const inspectorSession = new inspector.Session();
43
+ inspectorSession.connect();
44
+ // Enable debugging support so we can hear about the Debugger.scriptParsed event. We need that
45
+ // event to know how to map from scriptId's to file-urls.
46
+ await new Promise((resolve, reject) => {
47
+ inspectorSession.post("Debugger.enable", (err, res) => (err ? reject(err) : resolve(res)));
48
+ });
49
+ inspectorSession.addListener("Debugger.scriptParsed", (event) => {
50
+ const { scriptId, url } = event.params;
51
+ scriptIdToUrlMap.set(scriptId, url);
64
52
  });
53
+ return inspectorSession;
65
54
  }
66
55
  /**
67
56
  * Returns the inspector session that can be used to query the state of this
@@ -70,10 +59,8 @@ function createInspectorSessionAsync() {
70
59
  *
71
60
  * @internal
72
61
  */
73
- function getSessionAsync() {
74
- return __awaiter(this, void 0, void 0, function* () {
75
- return getSession();
76
- });
62
+ async function getSessionAsync() {
63
+ return getSession();
77
64
  }
78
65
  exports.getSessionAsync = getSessionAsync;
79
66
  /**
@@ -82,10 +69,8 @@ exports.getSessionAsync = getSessionAsync;
82
69
  *
83
70
  * @internal
84
71
  */
85
- function isInitializedAsync() {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- yield getSession();
88
- });
72
+ async function isInitializedAsync() {
73
+ await getSession();
89
74
  }
90
75
  exports.isInitializedAsync = isInitializedAsync;
91
76
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"v8Hooks.js","sourceRoot":"","sources":["../../../runtime/closure/v8Hooks.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE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