Skip to content

Commit 1bf8165

Browse files
committed
TS: Other review comments
1 parent 92dbfb2 commit 1bf8165

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

javascript/extractor/lib/typescript/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ function handleOpenProjectCommand(command: OpenProjectCommand) {
318318
console.warn('TypeScript: reported ' + diagnostics.length + ' semantic errors.');
319319
for (let diagnostic of diagnostics) {
320320
let text = diagnostic.messageText;
321-
if (typeof text !== 'string') {
321+
if (text && typeof text !== 'string') {
322322
text = text.messageText;
323323
}
324324
let locationStr = '';

javascript/extractor/lib/typescript/src/virtual_source_root.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import * as pathlib from "path";
22
import * as ts from "./typescript";
33

44
/**
5-
* Mapping from the source root to the virtual source root.
5+
* Mapping from the real source root to the virtual source root,
6+
* a directory whose folder structure mirrors the real source root, but with `node_modules` installed.
67
*/
78
export class VirtualSourceRoot {
89
constructor(

javascript/extractor/src/com/semmle/js/extractor/AutoBuild.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -709,12 +709,12 @@ protected DependencyInstallationResult installDependencies(Set<Path> filesToExtr
709709
propsToRemove.add(packageName);
710710
} else {
711711
// Remove file dependency on a package that don't exist in the checkout.
712-
String dependecy = getChildAsString(dependencyObj, packageName);
713-
if (dependecy != null && (dependecy.startsWith("file:") || dependecy.startsWith("./") || dependecy.startsWith("../"))) {
714-
if (dependecy.startsWith("file:")) {
715-
dependecy = dependecy.substring("file:".length());
712+
String dependency = getChildAsString(dependencyObj, packageName);
713+
if (dependency != null && (dependency.startsWith("file:") || dependency.startsWith("./") || dependency.startsWith("../"))) {
714+
if (dependency.startsWith("file:")) {
715+
dependency = dependency.substring("file:".length());
716716
}
717-
Path resolvedPackage = path.getParent().resolve(dependecy + "/package.json");
717+
Path resolvedPackage = path.getParent().resolve(dependency + "/package.json");
718718
if (!Files.exists(resolvedPackage)) {
719719
propsToRemove.add(packageName);
720720
}

0 commit comments

Comments
 (0)