Skip to content

Commit f60e95a

Browse files
committed
Update dependencies and dev dependencies
This notably includes updates for void → undefined, and causes us to start requiring Node.js v12 since the webidl-conversions dependency now does. Closes #249.
1 parent ab63e7e commit f60e95a

22 files changed

+1139
-2207
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node-version: [10, 12, 14, 15]
14+
node-version: [12, 14, 16]
1515
steps:
1616
- uses: actions/checkout@v2
1717
- uses: actions/setup-node@v2

lib/constructs/callback-function.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CallbackFunction {
3030
`;
3131

3232
let returnIDL = "";
33-
if (idl.idlType.idlType !== "void") {
33+
if (idl.idlType.idlType !== "undefined") {
3434
const conv = Types.generateTypeConversion(this.ctx, "callResult", idl.idlType, [], this.name, "context");
3535
this.requires.merge(conv.requires);
3636
returnIDL = `

lib/constructs/callback-interface.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class CallbackInterface {
139139
let callResult = Reflect.apply(X, thisArg, [${argNames.join(", ")}]);
140140
`;
141141

142-
if (operation.idlType.idlType !== "void") {
142+
if (operation.idlType.idlType !== "undefined") {
143143
const conv = Types.generateTypeConversion(this.ctx, "callResult", operation.idlType, [], name, "context");
144144
this.requires.merge(conv.requires);
145145
this.str += `

lib/context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const builtinTypes = webidl.parse(`
1111
typedef unsigned long long DOMTimeStamp;
1212
1313
callback Function = any (any... arguments);
14-
callback VoidFunction = void ();
14+
callback VoidFunction = undefined ();
1515
`);
1616

1717
function defaultProcessor(code) {

lib/types.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,7 @@ function generateTypeConversion(
140140
} else if (idlType.generic === "FrozenArray") {
141141
// frozen array type
142142
generateFrozenArray();
143-
} else if (
144-
// TODO: Revert once `Function` and `VoidFunction` are removed from `webidl-conversions`:
145-
idlType.idlType !== "Function" &&
146-
idlType.idlType !== "VoidFunction" &&
147-
conversions[idlType.idlType]
148-
) {
143+
} else if (conversions[idlType.idlType]) {
149144
// string or number type compatible with webidl-conversions
150145
generateGeneric(`conversions["${idlType.idlType}"]`);
151146
} else if (resolvedTypes.has(ctx.typeOf(idlType.idlType))) {

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
],
99
"repository": "github:jsdom/webidl2js",
1010
"dependencies": {
11-
"prettier": "^2.2.1",
12-
"webidl-conversions": "^6.1.0",
13-
"webidl2": "^23.13.1"
11+
"prettier": "^2.4.0",
12+
"webidl-conversions": "^7.0.0",
13+
"webidl2": "^24.1.2"
1414
},
1515
"devDependencies": {
16-
"@domenic/eslint-config": "^1.1.0",
17-
"eslint": "^7.21.0",
18-
"jest": "^26.6.3"
16+
"@domenic/eslint-config": "^1.3.0",
17+
"eslint": "^7.32.0",
18+
"jest": "^27.1.1"
1919
},
2020
"scripts": {
2121
"test": "jest",
@@ -29,7 +29,7 @@
2929
]
3030
},
3131
"engines": {
32-
"node": ">=10"
32+
"node": ">=12"
3333
},
3434
"author": "Sebastian Mayr <[email protected]>",
3535
"license": "MIT"
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[Exposed=Window]
22
interface BufferSourceTypes {
3-
void bs(BufferSource source);
4-
void ab(ArrayBuffer ab);
5-
void abv(ArrayBufferView abv);
6-
void u8a(Uint8Array u8);
3+
undefined bs(BufferSource source);
4+
undefined ab(ArrayBuffer ab);
5+
undefined abv(ArrayBufferView abv);
6+
undefined u8a(Uint8Array u8);
77

8-
void abUnion((ArrayBuffer or DOMString) ab);
9-
void u8aUnion((Uint8Array or DOMString) ab);
8+
undefined abUnion((ArrayBuffer or DOMString) ab);
9+
undefined u8aUnion((Uint8Array or DOMString) ab);
1010
};

test/cases/CEReactions.webidl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[Exposed=Window]
22
interface CEReactions {
33
[CEReactions] attribute DOMString attr;
4-
[CEReactions] void method();
4+
[CEReactions] undefined method();
55

66
getter DOMString (DOMString name);
7-
[CEReactions] setter void (DOMString name, DOMString value);
8-
[CEReactions] deleter void (DOMString name);
7+
[CEReactions] setter undefined (DOMString name, DOMString value);
8+
[CEReactions] deleter undefined (DOMString name);
99

1010
[CEReactions] Promise<void> promiseOperation();
1111
[CEReactions] readonly attribute Promise<void> promiseAttribute;

test/cases/Enum.webidl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[Exposed=Window]
22
interface Enum {
3-
void op(RequestDestination destination);
3+
undefined op(RequestDestination destination);
44
attribute RequestDestination attr;
55
};

test/cases/EventListener.webidl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
callback interface EventListener {
2-
void handleEvent(Event event);
2+
undefined handleEvent(Event event);
33
};

0 commit comments

Comments
 (0)