Browse Source

* server/adapters/cdp/index.js: Accept a frame id for completion

drone
Nicolas Petton 3 years ago
parent
commit
e620565925
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
2 changed files with 10 additions and 5 deletions
  1. +8
    -3
      server/adapters/cdp/index.js
  2. +2
    -2
      server/server/runtime.js

+ 8
- 3
server/adapters/cdp/index.js View File

@ -101,12 +101,17 @@ const getProperties = async (id) => {
return response.result;
};
const getCompletion = async (expression) => {
const getCompletion = async ({expression, frameId}) => {
ensureConnected();
let response = await state.client.Runtime.evaluate({
let method = state.currentCallFrameId
? state.client.Debugger.evaluateOnCallFrame
: state.client.Runtime.evaluate;
let response = await method({
expression,
objectGroup: "completion"
objectGroup: "completion",
callFrameId: frameId || state.currentCallFrameId
});
let { objectId, type } = response.result;


+ 2
- 2
server/server/runtime.js View File

@ -50,9 +50,9 @@ const evaluate = async ({ expression, frameId } = {}, { success, error }) => {
}
};
const getCompletion = async ({ expression } = {}, { success, error }) => {
const getCompletion = async ({ expression, frameId } = {}, { success, error }) => {
try {
success(await adapter.getCompletion(expression));
success(await adapter.getCompletion({expression, frameId}));
} catch(e) {
error(e.message);
}


Loading…
Cancel
Save