Make memory allocators pluggable

This commit is contained in:
dcodeIO
2018-01-28 19:33:05 +01:00
parent 78debee847
commit 896810859e
13 changed files with 16 additions and 41 deletions

View File

@ -82,6 +82,8 @@ export function normalize(path: string, trimExtension: bool = false, separator:
/** Resolves the specified path to a normalized path relative to the specified origin. */
export function resolve(normalizedPath: string, normalizedOrigin: string, separator: CharCode = CharCode.SLASH): string {
if (normalizedPath.startsWith("std:"))
return normalizedPath;
return normalize(dirname(normalizedOrigin, separator) + String.fromCharCode(separator) + normalizedPath);
}