Skip to content

Commit 219c106

Browse files
ExE-BossTimothyGu
andcommitted
Address review comments
Co-authored-by: Timothy Gu <[email protected]>
1 parent b8e7e0e commit 219c106

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

lib/constructs/callback-interface.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,7 @@ class CallbackInterface {
199199
generateInstall() {
200200
if (this.constants.size > 0) {
201201
this.str += `
202-
const exposed = new Set([
203-
`;
204-
205-
for (const globalName of this.exposed) {
206-
this.str += `"${globalName}",\n`;
207-
}
208-
209-
this.str += `
210-
]);
202+
const exposed = new Set(${JSON.stringify([...this.exposed])});
211203
`;
212204
}
213205

lib/constructs/interface.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,15 +1463,7 @@ class Interface {
14631463
const { idl, name } = this;
14641464

14651465
this.str += `
1466-
const exposed = new Set([
1467-
`;
1468-
1469-
for (const globalName of this.exposed) {
1470-
this.str += `"${globalName}",\n`;
1471-
}
1472-
1473-
this.str += `
1474-
]);
1466+
const exposed = new Set(${JSON.stringify([...this.exposed])});
14751467
14761468
exports.install = (globalObject, globalNames) => {
14771469
let isExposed = false;

0 commit comments

Comments
 (0)