Update roll_deps.py to also run javascript_natives/ script

With this change, we also update the argument hints for javascript
functions defined in .idl files when we roll Chromium deps.

DISABLE_THIRD_PARTY_CHECK=changes to roll_deps.py and javascript_natives/
are related

Change-Id: I0544acbe82a0292e486cfb3fac47b683438c3759
Bug: 1255619
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3431347
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
diff --git a/scripts/javascript_natives/index.js b/scripts/javascript_natives/index.js
index 26dc00e..58221a6 100644
--- a/scripts/javascript_natives/index.js
+++ b/scripts/javascript_natives/index.js
@@ -10,11 +10,14 @@
 
 import {parseTSFunction, postProcess, walkRoot} from './helpers.js';
 
-const program = ts.createProgram(
-    [
-      new URL('node_modules/typescript/lib/lib.esnext.d.ts', import.meta.url).pathname,
-    ],
-    {noLib: false, types: []});
+if (process.argv.length !== 4) {
+  throw new Error('Please provide path to chromium/src and devtools-frontend');
+}
+
+const chromiumSource = process.argv[2];
+const typescriptSource = process.argv[3] + 'node_modules/typescript/lib/lib.esnext.d.ts';
+
+const program = ts.createProgram([typescriptSource], {noLib: false, types: []});
 
 for (const file of program.getSourceFiles()) {
   ts.forEachChild(file, node => {
@@ -36,7 +39,7 @@
 // `devtools/devtools-frontend`, where `devtools` is on the same level
 // as `chromium`. This matches `scripts/npm_test.js`.
 const files =
-    glob.sync('../../../../chromium/src/third_party/blink/renderer/+(core|modules)/**/*.idl', {cwd: process.env.PWD});
+    glob.sync(`${chromiumSource}/third_party/blink/renderer/+(core|modules)/**/*.idl`, {cwd: process.env.PWD});
 
 for (const file of files) {
   if (file.includes('testing')) {
diff --git a/scripts/javascript_natives/package.json b/scripts/javascript_natives/package.json
index 86c8679..36421f0 100644
--- a/scripts/javascript_natives/package.json
+++ b/scripts/javascript_natives/package.json
@@ -7,10 +7,10 @@
   },
   "type": "module",
   "dependencies": {
-    "@types/webidl2": "^23.13.6",
-    "glob": "^7.1.2",
-    "mocha": "^9.1.4",
+    "@types/webidl2": "23.13.6",
+    "glob": "7.1.7",
+    "mocha": "9.1.3",
     "typescript": "latest",
-    "webidl2": "^24.2.0"
+    "webidl2": "24.2.0"
   }
 }