Skip to content

Commit 5b236e5

Browse files
Mohsen Azimisokra
authored andcommitted
More type fixes (these changes should be merged as separate PRs
1 parent 2267906 commit 5b236e5

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

lib/debug/ProfilingPlugin.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,24 @@ const makeInterceptorFor = (instance, tracer) => hookName => ({
320320
}
321321
});
322322

323+
/**
324+
* @typedef NewProfiledTapOptions
325+
* @property {string} name
326+
* @property {string} type
327+
* @property {Function} fn
328+
* @description Options for the profiled fn.
329+
*/
330+
323331
/**
324332
* @param {string} hookName Name of the hook to profile.
325333
* @param {{counter: number, trace: *, profiler: *}} tracer Instance of tracer.
326-
* @param {{name: string, type: string, fn: Function}} opts Options for the profiled fn.
327334
* @returns {*} Chainable hooked function.
328335
*/
329-
const makeNewProfiledTapFn = (hookName, tracer, { name, type, fn }) => {
336+
const makeNewProfiledTapFn = (
337+
hookName,
338+
tracer,
339+
/** @type {NewProfiledTapOptions} */ { name, type, fn }
340+
) => {
330341
const defaultCategory = ["blink.user_timing"];
331342

332343
switch (type) {

lib/dependencies/HarmonyAcceptImportDependency.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const HarmonyImportDependency = require("./HarmonyImportDependency");
88
class HarmonyAcceptImportDependency extends HarmonyImportDependency {
99
constructor(request, originModule, parserScope) {
1010
super(request, originModule, NaN, parserScope);
11+
this.isImportEmitted = undefined;
1112
this.weak = true;
1213
}
1314

lib/util/objectToMap.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
*/
88
module.exports = function objectToMap(obj) {
99
return new Map(
10-
Object.keys(obj).map(key => /** @type [string, string] */ [key, obj[key]])
10+
Object.keys(obj).map(key => {
11+
/** @type {[string, string]} */
12+
const pair = [key, obj[key]];
13+
return pair;
14+
})
1115
);
1216
};

0 commit comments

Comments
 (0)