MCPcopy Index your code
hub / github.com/Moddable-OpenSource/moddable / run

Method run

tools/cdv.js:86–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 }
85
86 run() {
87 const source = this.readFileString(this.sourcePath);
88 const result = compileDataView(source, this.pragmas);
89
90 if (result.errors) {
91 this.report(result.errors);
92 throw new Error("cdv failed for " + this.sourcePath);
93 }
94
95 const parts = this.splitPath(this.sourcePath);
96 parts.extension = "." + result.language;
97 if (this.outputDirectory)
98 parts.directory = this.outputDirectory;
99 if (this.outputName)
100 parts.name = this.outputName;
101 const outputPath = this.joinPath(parts);
102
103 const output = new FILE(outputPath, "wb");
104 output.writeString(result.script);
105 output.close();
106 }
107}

Callers

nothing calls this directly

Calls 4

compileDataViewFunction · 0.85
reportMethod · 0.80
closeMethod · 0.65
writeStringMethod · 0.45

Tested by

no test coverage detected