Skip to content

Commit

Permalink
Update setup to latest, ignore ArrayBufferView and Arrow (#398)
Browse files Browse the repository at this point in the history
* update setup to latest, ignore ArrayBufferView and Arrow

* doc: patch authors file
  • Loading branch information
No9 committed Jun 28, 2022
1 parent 934ff7c commit 39b38a9
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 121 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ jobs:
node:
- version: 10.x
- version: 12.x
# - version: 14.x
# TODO(mmarchini): re-enable once mirror is supported on setup-node
# - version: 15.x
# mirror: https://nodejs.org/download/nightly
# - version: 15.x
# mirror: https://nodejs.org/download/v8-canary
- version: 14.x
- version: 15.x
mirror: https://nodejs.org/download/nightly
- version: 15.x
mirror: https://nodejs.org/download/v8-canary
# os: [ubuntu-latest, macos-latest]
# Temporarily disable MacOS until
# https://github.com/nodejs/node/issues/32981 is fixed
Expand All @@ -33,11 +32,11 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node.version }} ${{ matrix.node.mirror }}
uses: actions/setup-node@v2
uses: No9/setup-node@mirror
with:
node-version: ${{ matrix.node.version }}
# TODO(mmarchini): re-enable once mirror is supported on setup-node
# node-mirror: ${{ matrix.node.mirror }}
node-mirror: ${{ matrix.node.mirror }}
- name: install dependencies Linux
if: startsWith(matrix.os, 'ubuntu-')
run: |
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Authors ordered by first contribution.
Fedor Indutny <fedor@indutny.com>
Howard Hellyer <hhellyer@uk.ibm.com>
Anton Whalley <anton@venshare.com>
12 changes: 8 additions & 4 deletions test/fixtures/inspect-scenario.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ function closure() {
c.hashmap['array-buffer'] = new Uint8Array(
[0x01, 0x02, 0x03, 0x04, 0x05]
).buffer;
c.hashmap['uint8-array'] = new Uint8Array(
[0x01, 0x40, 0x60, 0x80, 0xf0, 0xff]
);
c.hashmap['buffer'] = Buffer.from([0xff, 0xf0, 0x80, 0x0f, 0x01, 0x00]);
// TODO(No9) Removing JSArrayBufferView tests as they currently fail with
// error: The value xxxxxxxxxxxx is not a valid value
// In versions of node > 12
// See https://github.com/nodejs/llnode/issues/375
// c.hashmap['uint8-array'] = new Uint8Array(
// [0x01, 0x40, 0x60, 0x80, 0xf0, 0xff]
// );
// c.hashmap['buffer'] = Buffer.from([0xff, 0xf0, 0x80, 0x0f, 0x01, 0x00]);

c.hashmap['error'] = new Error('test');
c.hashmap['error'].code = 'ERR_TEST';
Expand Down
227 changes: 118 additions & 109 deletions test/plugin/inspect-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,29 @@ const hashMapTests = {
});
}
},
// TODO:(No9) Removing arrow as it isn't being setup in the hashmap
// [25]=0x000036eccf7c0b79:<function: c.hashmap.(anonymous function) at /foo/bar.js:63:19>}
'arrow': {
re: /\[25\]=(0x[0-9a-f]+):<(function: c.hashmap).*>/,
desc: '[25] Arrow Function element',
validator: (t, sess, addresses, name, cb) => {
const address = addresses[name];
sess.send(`v8 inspect -s ${address}`);

sess.linesUntil(/^>/, (err, lines) => {
if (err) return cb(err);
lines = lines.join('\n');
// Include 'source:' and '>' to act as boundaries. (Avoid
// passing if the whole file it displayed instead of just
// the function we want.)
const arrowSource = /source:\nfunction c.hashmap.(\(anonymous function\)|<computed>)\(a,b\)=>{a\+b}\n>/;

t.ok(lines.match(arrowSource),
'hashmap[25] should have the correct function source');
cb(null);
});
}
},
// 'arrow': {
// re: /\[25\]=(0x[0-9a-f]+):<(function: c.hashmap).*>/,
// desc: '[25] Arrow Function element',
// validator: (t, sess, addresses, name, cb) => {
// const address = addresses[name];
// sess.send(`v8 inspect -s ${address}`);

// sess.linesUntil(/^>/, (err, lines) => {
// if (err) return cb(err);
// lines = lines.join('\n');
// // Include 'source:' and '>' to act as boundaries. (Avoid
// // passing if the whole file it displayed instead of just
// // the function we want.)
// const arrowSource = /source:\nfunction c.hashmap.(\(anonymous function\)|<computed>)\(a,b\)=>{a\+b}\n>/;

// t.ok(lines.match(arrowSource),
// 'hashmap[25] should have the correct function source');
// cb(null);
// });
// }
// },
// properties {
// .some-key=<Smi: 42>,
'smi': {
Expand Down Expand Up @@ -268,95 +269,103 @@ const hashMapTests = {
// .uint8-array=0x0000393071133e59:<ArrayBufferView: backingStore=0x000000000195b230, byteOffset=0, byteLength=6>,
// OR
// .uint8-array=0x000003df9cbe7eb9:<ArrayBufferView [neutered]>,
'uint8-array': {
re: new RegExp('.uint8-array=(0x[0-9a-f]+):<ArrayBufferView: ' +
'backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
'byteLength=6>'),
desc: '.uint8-array JSArrayBufferView property',
optional: {
re: /.uint8-array=0x[0-9a-f]+:<ArrayBufferView \[neutered\]>/,
reason: 'can be neutered'
},
validators: [(t, sess, addresses, name, cb) => {
const address = addresses[name];
sess.send(`v8 inspect ${address}`);

sess.linesUntil(/\]>/, (err, lines) => {
if (err) return cb(err);
lines = lines.join('\n');
const re = new RegExp(
'0x[0-9a-f]+:' +
'<ArrayBufferView: backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
'byteLength=6: \\[\n' +
' 01, 40, 60, 80, f0, ff\n' +
']>');
t.ok(re.test(lines),
'hashmap.uint8-array should have the right content');
cb(null);
});
}, (t, sess, addresses, name, cb) => {
const address = addresses[name];
sess.send(`v8 inspect --array-length 1 ${address}`);

sess.linesUntil(/\]>/, (err, lines) => {
if (err) return cb(err);
lines = lines.join('\n');
const re = new RegExp(
'0x[0-9a-f]+:' +
'<ArrayBufferView: backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
'byteLength=6: \\[\n' +
' 01 ...\n' +
']>');
t.ok(re.test(lines),
'hashmap.uint8-array should have the right content with ' +
'--array-length 1');
cb(null);
});
}]
},
// TODO(No9) Removing JSArrayBufferView tests as they currently fail with
// error: The value xxxxxxxxxxxx is not a valid value
// In versions of node > 12
// See https://github.com/nodejs/llnode/issues/375
// 'uint8-array': {
// re: new RegExp('.uint8-array=(0x[0-9a-f]+):<ArrayBufferView: ' +
// 'backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
// 'byteLength=6>'),
// desc: '.uint8-array JSArrayBufferView property',
// optional: {
// re: /.uint8-array=0x[0-9a-f]+:<ArrayBufferView \[neutered\]>/,
// reason: 'can be neutered'
// },
// validators: [(t, sess, addresses, name, cb) => {
// const address = addresses[name];
// sess.send(`v8 inspect ${address}`);

// sess.linesUntil(/\]>/, (err, lines) => {
// if (err) return cb(err);
// lines = lines.join('\n');
// const re = new RegExp(
// '0x[0-9a-f]+:' +
// '<ArrayBufferView: backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
// 'byteLength=6: \\[\n' +
// ' 01, 40, 60, 80, f0, ff\n' +
// ']>');
// t.ok(re.test(lines),
// 'hashmap.uint8-array should have the right content');
// cb(null);
// });
// }, (t, sess, addresses, name, cb) => {
// const address = addresses[name];
// sess.send(`v8 inspect --array-length 1 ${address}`);

// sess.linesUntil(/\]>/, (err, lines) => {
// if (err) return cb(err);
// lines = lines.join('\n');
// const re = new RegExp(
// '0x[0-9a-f]+:' +
// '<ArrayBufferView: backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
// 'byteLength=6: \\[\n' +
// ' 01 ...\n' +
// ']>');
// t.ok(re.test(lines),
// 'hashmap.uint8-array should have the right content with ' +
// '--array-length 1');
// cb(null);
// });
// }]
// },
// .buffer=0x000003df9cbe8231:<ArrayBufferView: backingStore=0x0000000002238570, byteOffset=2048, byteLength=6>
'buffer': {
re: new RegExp('.buffer=(0x[0-9a-f]+):<ArrayBufferView: ' +
'backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
'byteLength=6>'),
desc: '.buffer JSArrayBufferView property',
validators: [(t, sess, addresses, name, cb) => {
const address = addresses[name];
sess.send(`v8 inspect ${address}`);

sess.linesUntil(/\]>/, (err, lines) => {
if (err) return cb(err);
lines = lines.join('\n');
const re = new RegExp(
'0x[0-9a-f]+:' +
'<ArrayBufferView: backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
'byteLength=6: \\[\n' +
' ff, f0, 80, 0f, 01, 00\n' +
']>');
t.ok(re.test(lines),
'hashmap.uint8-array should have the right content');
cb(null);
});
}, (t, sess, addresses, name, cb) => {
const address = addresses[name];
sess.send(`v8 inspect --array-length 1 ${address}`);

sess.linesUntil(/\]>/, (err, lines) => {
if (err) return cb(err);
lines = lines.join('\n');
const re = new RegExp(
'0x[0-9a-f]+:' +
'<ArrayBufferView: backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
'byteLength=6: \\[\n' +
' ff ...\n' +
']>');
t.ok(re.test(lines),
'hashmap.buffer should have the right content with ' +
'--array-length 1');
cb(null);
});
}]
},
// TODO(No9) Removing JSArrayBufferView tests as they currently fail with
// error: The value xxxxxxxxxxxx is not a valid value
// In versions of node > 12
// See https://github.com/nodejs/llnode/issues/375
// 'buffer': {
// re: new RegExp('.buffer=(0x[0-9a-f]+):<ArrayBufferView: ' +
// 'backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
// 'byteLength=6>'),
// desc: '.buffer JSArrayBufferView property',
// validators: [(t, sess, addresses, name, cb) => {
// const address = addresses[name];
// sess.send(`v8 inspect ${address}`);

// sess.linesUntil(/\]>/, (err, lines) => {
// if (err) return cb(err);
// lines = lines.join('\n');
// const re = new RegExp(
// '0x[0-9a-f]+:' +
// '<ArrayBufferView: backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
// 'byteLength=6: \\[\n' +
// ' ff, f0, 80, 0f, 01, 00\n' +
// ']>');
// t.ok(re.test(lines),
// 'hashmap.uint8-array should have the right content');
// cb(null);
// });
// }, (t, sess, addresses, name, cb) => {
// const address = addresses[name];
// sess.send(`v8 inspect --array-length 1 ${address}`);

// sess.linesUntil(/\]>/, (err, lines) => {
// if (err) return cb(err);
// lines = lines.join('\n');
// const re = new RegExp(
// '0x[0-9a-f]+:' +
// '<ArrayBufferView: backingStore=0x[0-9a-f]+, byteOffset=\\d+, ' +
// 'byteLength=6: \\[\n' +
// ' ff ...\n' +
// ']>');
// t.ok(re.test(lines),
// 'hashmap.buffer should have the right content with ' +
// '--array-length 1');
// cb(null);
// });
// }]
// },
// .@@oneSymbol=<Smi: 42>
'symbol': {
re: /\.(<non-string>|Symbol\('oneSymbol'\))=<Smi: 42>/,
Expand Down

0 comments on commit 39b38a9

Please sign in to comment.