Skip to content

Commit

Permalink
Lint fixes and format
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Aug 10, 2018
1 parent fa16122 commit 2fe89cb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
40 changes: 21 additions & 19 deletions js/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function makeDefine(fileName: string): AmdDefine {
util.assert(currentModule != null);
const localExports = currentModule!.exports;
log("localDefine", fileName, deps, localExports);
const args = deps.map((dep) => {
const args = deps.map(dep => {
if (dep === "require") {
return localRequire;
} else if (dep === "exports") {
Expand Down Expand Up @@ -289,7 +289,7 @@ class TypeScriptHost implements ts.LanguageServiceHost {
getScriptVersion(fileName: string): string {
util.log("getScriptVersion", fileName);
const m = FileModule.load(fileName);
return m && m.scriptVersion || "";
return (m && m.scriptVersion) || "";
}

getScriptSnapshot(fileName: string): ts.IScriptSnapshot | undefined {
Expand Down Expand Up @@ -344,23 +344,25 @@ class TypeScriptHost implements ts.LanguageServiceHost {
containingFile: string
): ts.ResolvedModule[] {
//util.log("resolveModuleNames", { moduleNames, reusedNames });
return moduleNames.map((name) => {
let resolvedFileName;
if (name === "deno") {
resolvedFileName = resolveModuleName("deno.d.ts", ASSETS);
} else if (name === "typescript") {
resolvedFileName = resolveModuleName("typescript.d.ts", ASSETS);
} else {
resolvedFileName = resolveModuleName(name, containingFile);
}
if (resolvedFileName == null) {
return undefined;
}
// This flags to the compiler to not go looking to transpile functional
// code, anything that is in `/$asset$/` is just library code
const isExternalLibraryImport = resolvedFileName.startsWith(ASSETS);
return { resolvedFileName, isExternalLibraryImport };
}).filter((mod) => mod != null) as ts.ResolvedModule[];
return moduleNames
.map(name => {
let resolvedFileName;
if (name === "deno") {
resolvedFileName = resolveModuleName("deno.d.ts", ASSETS);
} else if (name === "typescript") {
resolvedFileName = resolveModuleName("typescript.d.ts", ASSETS);
} else {
resolvedFileName = resolveModuleName(name, containingFile);
}
if (resolvedFileName == null) {
return undefined;
}
// This flags to the compiler to not go looking to transpile functional
// code, anything that is in `/$asset$/` is just library code
const isExternalLibraryImport = resolvedFileName.startsWith(ASSETS);
return { resolvedFileName, isExternalLibraryImport };
})
.filter(mod => mod != null) as ts.ResolvedModule[];
}
}

Expand Down
4 changes: 2 additions & 2 deletions js/v8_source_maps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function wrapCallSite(frame: CallSite): CallSite {
}

// Code called using eval() needs special handling
let origin = frame.isEval() && frame.getEvalOrigin() || undefined;
let origin = (frame.isEval() && frame.getEvalOrigin()) || undefined;
if (origin) {
origin = mapEvalOrigin(origin);
frame = cloneCallSite(frame);
Expand Down Expand Up @@ -162,7 +162,7 @@ function CallSiteToString(frame: CallSite): string {
line += ` [as ${methodName} ]`;
}
} else {
line += typeName + "." + (methodName || "<anonymous>");
line += `${typeName}.${methodName || "<anonymous>"}`;
}
} else if (isConstructor) {
line += "new " + (functionName || "<anonymous>");
Expand Down

0 comments on commit 2fe89cb

Please sign in to comment.