mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Condition the custom serialization on the existance of JSON
This commit is contained in:
parent
7e6bb85be4
commit
09d6e4aaa6
@ -604,6 +604,17 @@ module ts {
|
||||
};
|
||||
|
||||
function serializeSourceMapContents(version: number, file: string, sourceRoot: string, sources: string[], names: string[], mappings: string) {
|
||||
if (typeof JSON !== "undefined") {
|
||||
return JSON.stringify({
|
||||
version: version,
|
||||
file: file,
|
||||
sourceRoot: sourceRoot,
|
||||
sources: sources,
|
||||
names: names,
|
||||
mappings: mappings
|
||||
});
|
||||
}
|
||||
|
||||
return "{\"version\":" + version + ",\"file\":\"" + escapeString(file) + "\",\"sourceRoot\":\"" + escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + escapeString(mappings) + "\"}";
|
||||
|
||||
/** This does not support the full escape characters, it only supports the subset that can be used in file names
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user