mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
format
This commit is contained in:
parent
a6f6d0b712
commit
7fb2821937
4 changed files with 19 additions and 15 deletions
|
@ -418,10 +418,10 @@ export class DenoCompiler
|
||||||
*/
|
*/
|
||||||
compile(moduleMetaData: ModuleMetaData): OutputCode {
|
compile(moduleMetaData: ModuleMetaData): OutputCode {
|
||||||
const recompile = !!this.recompile;
|
const recompile = !!this.recompile;
|
||||||
this._log(
|
this._log("compiler.compile", {
|
||||||
"compiler.compile",
|
filename: moduleMetaData.fileName,
|
||||||
{ filename: moduleMetaData.fileName, recompile }
|
recompile
|
||||||
);
|
});
|
||||||
if (!recompile && moduleMetaData.outputCode) {
|
if (!recompile && moduleMetaData.outputCode) {
|
||||||
return moduleMetaData.outputCode;
|
return moduleMetaData.outputCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -461,10 +461,18 @@ test(function compilerGetScriptFileNames() {
|
||||||
test(function compilerRecompileFlag() {
|
test(function compilerRecompileFlag() {
|
||||||
setup();
|
setup();
|
||||||
compilerInstance.run("foo/bar.ts", "/root/project");
|
compilerInstance.run("foo/bar.ts", "/root/project");
|
||||||
assertEqual(getEmitOutputStack.length, 1, "Expected only a single emitted file.");
|
assertEqual(
|
||||||
|
getEmitOutputStack.length,
|
||||||
|
1,
|
||||||
|
"Expected only a single emitted file."
|
||||||
|
);
|
||||||
// running compiler against same file should use cached code
|
// running compiler against same file should use cached code
|
||||||
compilerInstance.run("foo/bar.ts", "/root/project");
|
compilerInstance.run("foo/bar.ts", "/root/project");
|
||||||
assertEqual(getEmitOutputStack.length, 1, "Expected only a single emitted file.");
|
assertEqual(
|
||||||
|
getEmitOutputStack.length,
|
||||||
|
1,
|
||||||
|
"Expected only a single emitted file."
|
||||||
|
);
|
||||||
compilerInstance.recompile = true;
|
compilerInstance.recompile = true;
|
||||||
compilerInstance.run("foo/bar.ts", "/root/project");
|
compilerInstance.run("foo/bar.ts", "/root/project");
|
||||||
assertEqual(getEmitOutputStack.length, 2, "Expected two emitted file.");
|
assertEqual(getEmitOutputStack.length, 2, "Expected two emitted file.");
|
||||||
|
|
|
@ -24,9 +24,7 @@ export async function readlink(name: string): Promise<string> {
|
||||||
return res(await dispatch.sendAsync(...req(name)));
|
return res(await dispatch.sendAsync(...req(name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
function req(
|
function req(name: string): [flatbuffers.Builder, fbs.Any, flatbuffers.Offset] {
|
||||||
name: string
|
|
||||||
): [flatbuffers.Builder, fbs.Any, flatbuffers.Offset] {
|
|
||||||
const builder = new flatbuffers.Builder();
|
const builder = new flatbuffers.Builder();
|
||||||
const name_ = builder.createString(name);
|
const name_ = builder.createString(name);
|
||||||
fbs.Readlink.startReadlink(builder);
|
fbs.Readlink.startReadlink(builder);
|
||||||
|
|
|
@ -180,8 +180,7 @@ fn parse_core_args(args: Vec<String>) -> (Vec<String>, Vec<String>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
})
|
}).collect();
|
||||||
.collect();
|
|
||||||
|
|
||||||
// Replace args being sent to V8
|
// Replace args being sent to V8
|
||||||
for idx in 0..args.len() {
|
for idx in 0..args.len() {
|
||||||
|
@ -247,7 +246,6 @@ pub fn v8_set_flags(args: Vec<String>) -> Vec<String> {
|
||||||
let cstr = CStr::from_ptr(*ptr as *const i8);
|
let cstr = CStr::from_ptr(*ptr as *const i8);
|
||||||
let slice = cstr.to_str().unwrap();
|
let slice = cstr.to_str().unwrap();
|
||||||
slice.to_string()
|
slice.to_string()
|
||||||
})
|
}).chain(rest.into_iter())
|
||||||
.chain(rest.into_iter())
|
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue