build: enable JS semicolons (#22783)
This commit is contained in:
parent
24e21467b9
commit
5d657dece4
354 changed files with 21512 additions and 21510 deletions
68
spec/fixtures/module/inspector-binding.js
vendored
68
spec/fixtures/module/inspector-binding.js
vendored
|
@ -1,18 +1,18 @@
|
|||
const inspector = require('inspector')
|
||||
const path = require('path')
|
||||
const { pathToFileURL } = require('url')
|
||||
const inspector = require('inspector');
|
||||
const path = require('path');
|
||||
const { pathToFileURL } = require('url');
|
||||
|
||||
// This test case will set a breakpoint 4 lines below
|
||||
function debuggedFunction () {
|
||||
let i
|
||||
let accum = 0
|
||||
let i;
|
||||
let accum = 0;
|
||||
for (i = 0; i < 5; i++) {
|
||||
accum += i
|
||||
accum += i;
|
||||
}
|
||||
return accum
|
||||
return accum;
|
||||
}
|
||||
|
||||
let scopeCallback = null
|
||||
let scopeCallback = null;
|
||||
|
||||
function checkScope (session, scopeId) {
|
||||
session.post('Runtime.getProperties', {
|
||||
|
@ -20,57 +20,57 @@ function checkScope (session, scopeId) {
|
|||
ownProperties: false,
|
||||
accessorPropertiesOnly: false,
|
||||
generatePreview: true
|
||||
}, scopeCallback)
|
||||
}, scopeCallback);
|
||||
}
|
||||
|
||||
function debuggerPausedCallback (session, notification) {
|
||||
const params = notification.params
|
||||
const callFrame = params.callFrames[0]
|
||||
const scopeId = callFrame.scopeChain[0].object.objectId
|
||||
checkScope(session, scopeId)
|
||||
const params = notification.params;
|
||||
const callFrame = params.callFrames[0];
|
||||
const scopeId = callFrame.scopeChain[0].object.objectId;
|
||||
checkScope(session, scopeId);
|
||||
}
|
||||
|
||||
function testSampleDebugSession () {
|
||||
let cur = 0
|
||||
const failures = []
|
||||
let cur = 0;
|
||||
const failures = [];
|
||||
const expects = {
|
||||
i: [0, 1, 2, 3, 4],
|
||||
accum: [0, 0, 1, 3, 6]
|
||||
}
|
||||
};
|
||||
scopeCallback = function (error, result) {
|
||||
if (error) failures.push(error)
|
||||
const i = cur++
|
||||
let v, actual, expected
|
||||
if (error) failures.push(error);
|
||||
const i = cur++;
|
||||
let v, actual, expected;
|
||||
for (v of result.result) {
|
||||
actual = v.value.value
|
||||
expected = expects[v.name][i]
|
||||
actual = v.value.value;
|
||||
expected = expects[v.name][i];
|
||||
if (actual !== expected) {
|
||||
failures.push(`Iteration ${i} variable: ${v.name} ` +
|
||||
`expected: ${expected} actual: ${actual}`)
|
||||
`expected: ${expected} actual: ${actual}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
const session = new inspector.Session()
|
||||
session.connect()
|
||||
};
|
||||
const session = new inspector.Session();
|
||||
session.connect();
|
||||
session.on('Debugger.paused',
|
||||
(notification) => debuggerPausedCallback(session, notification))
|
||||
let cbAsSecondArgCalled = false
|
||||
session.post('Debugger.enable', () => { cbAsSecondArgCalled = true })
|
||||
(notification) => debuggerPausedCallback(session, notification));
|
||||
let cbAsSecondArgCalled = false;
|
||||
session.post('Debugger.enable', () => { cbAsSecondArgCalled = true; });
|
||||
session.post('Debugger.setBreakpointByUrl', {
|
||||
lineNumber: 9,
|
||||
url: pathToFileURL(path.resolve(__dirname, __filename)).toString(),
|
||||
columnNumber: 0,
|
||||
condition: ''
|
||||
})
|
||||
});
|
||||
|
||||
debuggedFunction()
|
||||
scopeCallback = null
|
||||
session.disconnect()
|
||||
debuggedFunction();
|
||||
scopeCallback = null;
|
||||
session.disconnect();
|
||||
process.send({
|
||||
cmd: 'assert',
|
||||
debuggerEnabled: cbAsSecondArgCalled,
|
||||
success: (cur === 5) && (failures.length === 0)
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
testSampleDebugSession()
|
||||
testSampleDebugSession();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue