mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
Use 2 space indent.
Apologies for the churn, but my screen is small. rustfmt assumes big monitors.
This commit is contained in:
parent
a7bf154cb8
commit
21c4b8a42d
4 changed files with 254 additions and 248 deletions
|
@ -124,9 +124,15 @@ fn test_resolve_module() {
|
||||||
let test_cases = [
|
let test_cases = [
|
||||||
(
|
(
|
||||||
"./subdir/print_hello.ts",
|
"./subdir/print_hello.ts",
|
||||||
add_root!("/Users/rld/go/src/github.com/ry/deno/testdata/006_url_imports.ts"),
|
add_root!(
|
||||||
add_root!("/Users/rld/go/src/github.com/ry/deno/testdata/subdir/print_hello.ts"),
|
"/Users/rld/go/src/github.com/ry/deno/testdata/006_url_imports.ts"
|
||||||
add_root!("/Users/rld/go/src/github.com/ry/deno/testdata/subdir/print_hello.ts"),
|
),
|
||||||
|
add_root!(
|
||||||
|
"/Users/rld/go/src/github.com/ry/deno/testdata/subdir/print_hello.ts"
|
||||||
|
),
|
||||||
|
add_root!(
|
||||||
|
"/Users/rld/go/src/github.com/ry/deno/testdata/subdir/print_hello.ts"
|
||||||
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"testdata/001_hello.js",
|
"testdata/001_hello.js",
|
||||||
|
@ -185,8 +191,7 @@ pub extern "C" fn handle_code_fetch(
|
||||||
let result = resolve_module(&module_specifier, &containing_file);
|
let result = resolve_module(&module_specifier, &containing_file);
|
||||||
if result.is_err() {
|
if result.is_err() {
|
||||||
let err = result.unwrap_err();
|
let err = result.unwrap_err();
|
||||||
let errmsg =
|
let errmsg = format!("{} {} {}", err, module_specifier, containing_file);
|
||||||
format!("{} {} {}", err, module_specifier, containing_file);
|
|
||||||
let errmsg_c = as_cstring(&errmsg);
|
let errmsg_c = as_cstring(&errmsg);
|
||||||
unsafe { deno_reply_error(d, cmd_id, errmsg_c.as_ptr()) };
|
unsafe { deno_reply_error(d, cmd_id, errmsg_c.as_ptr()) };
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -24,7 +24,8 @@ fn set_flags() -> Vec<String> {
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
// Make a new array, that can be modified by V8::SetFlagsFromCommandLine(),
|
// Make a new array, that can be modified by V8::SetFlagsFromCommandLine(),
|
||||||
// containing mutable raw pointers to the individual command line args.
|
// containing mutable raw pointers to the individual command line args.
|
||||||
let mut c_argv = argv.iter_mut()
|
let mut c_argv = argv
|
||||||
|
.iter_mut()
|
||||||
.map(|arg| arg.as_mut_ptr() as *mut i8)
|
.map(|arg| arg.as_mut_ptr() as *mut i8)
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
// Store the length of the argv array in a local variable. We'll pass a
|
// Store the length of the argv array in a local variable. We'll pass a
|
||||||
|
@ -67,9 +68,8 @@ impl Deno {
|
||||||
) -> Result<(), DenoException> {
|
) -> Result<(), DenoException> {
|
||||||
let filename = CString::new(js_filename).unwrap();
|
let filename = CString::new(js_filename).unwrap();
|
||||||
let source = CString::new(js_source).unwrap();
|
let source = CString::new(js_source).unwrap();
|
||||||
let r = unsafe {
|
let r =
|
||||||
deno_execute(self.ptr, filename.as_ptr(), source.as_ptr())
|
unsafe { deno_execute(self.ptr, filename.as_ptr(), source.as_ptr()) };
|
||||||
};
|
|
||||||
if r == 0 {
|
if r == 0 {
|
||||||
let ptr = unsafe { deno_last_exception(self.ptr) };
|
let ptr = unsafe { deno_last_exception(self.ptr) };
|
||||||
let cstr = unsafe { CStr::from_ptr(ptr) };
|
let cstr = unsafe { CStr::from_ptr(ptr) };
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
max_width = 80
|
max_width = 80
|
||||||
|
tab_spaces = 2
|
||||||
|
|
Loading…
Reference in a new issue