1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00

Use underscores in filenames.

This commit is contained in:
Ryan Dahl 2018-10-03 21:41:59 -04:00
parent 818ad37678
commit 2f44db6756
11 changed files with 48 additions and 48 deletions

View file

@ -76,9 +76,9 @@ ts_sources = [
"js/dom_types.ts",
"js/errors.ts",
"js/fetch.ts",
"js/fileinfo.ts",
"js/file_info.ts",
"js/files.ts",
"js/global-eval.ts",
"js/global_eval.ts",
"js/globals.ts",
"js/io.ts",
"js/libdeno.ts",

View file

@ -3,7 +3,7 @@
import * as ts from "typescript";
import { assetSourceCode } from "./assets";
import * as deno from "./deno";
import { globalEval } from "./global-eval";
import { globalEval } from "./global_eval";
import { libdeno } from "./libdeno";
import { window } from "./globals";
import * as os from "./os";

View file

@ -20,6 +20,6 @@ export { libdeno } from "./libdeno";
export { platform } from "./platform";
export { trace } from "./trace";
export { truncateSync, truncate } from "./truncate";
export { FileInfo } from "./fileinfo";
export { FileInfo } from "./file_info";
export { connect, dial, listen, Listener, Conn } from "./net";
export const args: string[] = [];

View file

@ -5,7 +5,7 @@ import * as timers from "./timers";
import * as textEncoding from "./text_encoding";
import * as fetch_ from "./fetch";
import { libdeno } from "./libdeno";
import { globalEval } from "./global-eval";
import { globalEval } from "./global_eval";
import { DenoHeaders } from "./fetch";
import { DenoBlob } from "./blob";

View file

@ -1,5 +1,5 @@
import { RawSourceMap } from "./types";
import { globalEval } from "./global-eval";
import { globalEval } from "./global_eval";
// The libdeno functions are moved so that users can't access them.
type MessageCallback = (msg: Uint8Array) => void;

View file

@ -1,7 +1,7 @@
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
import { ReadResult, Reader, Writer, Closer } from "./io";
import * as fbs from "gen/msg_generated";
import * as msg from "gen/msg_generated";
import { assert, notImplemented } from "./util";
import * as dispatch from "./dispatch";
import { flatbuffers } from "flatbuffers";
@ -32,14 +32,14 @@ class ListenerImpl implements Listener {
async accept(): Promise<Conn> {
const builder = new flatbuffers.Builder();
fbs.Accept.startAccept(builder);
fbs.Accept.addRid(builder, this.fd);
const msg = fbs.Accept.endAccept(builder);
const baseRes = await dispatch.sendAsync(builder, fbs.Any.Accept, msg);
msg.Accept.startAccept(builder);
msg.Accept.addRid(builder, this.fd);
const inner = msg.Accept.endAccept(builder);
const baseRes = await dispatch.sendAsync(builder, msg.Any.Accept, inner);
assert(baseRes != null);
assert(fbs.Any.NewConn === baseRes!.msgType());
const res = new fbs.NewConn();
assert(baseRes!.msg(res) != null);
assert(msg.Any.NewConn === baseRes!.innerType());
const res = new msg.NewConn();
assert(baseRes!.inner(res) != null);
return new ConnImpl(res.rid(), res.remoteAddr()!, res.localAddr()!);
}
@ -112,15 +112,15 @@ export function listen(network: Network, address: string): Listener {
const builder = new flatbuffers.Builder();
const network_ = builder.createString(network);
const address_ = builder.createString(address);
fbs.Listen.startListen(builder);
fbs.Listen.addNetwork(builder, network_);
fbs.Listen.addAddress(builder, address_);
const msg = fbs.Listen.endListen(builder);
const baseRes = dispatch.sendSync(builder, fbs.Any.Listen, msg);
msg.Listen.startListen(builder);
msg.Listen.addNetwork(builder, network_);
msg.Listen.addAddress(builder, address_);
const inner = msg.Listen.endListen(builder);
const baseRes = dispatch.sendSync(builder, msg.Any.Listen, inner);
assert(baseRes != null);
assert(fbs.Any.ListenRes === baseRes!.msgType());
const res = new fbs.ListenRes();
assert(baseRes!.msg(res) != null);
assert(msg.Any.ListenRes === baseRes!.innerType());
const res = new msg.ListenRes();
assert(baseRes!.inner(res) != null);
return new ListenerImpl(res.rid());
}
@ -154,15 +154,15 @@ export async function dial(network: Network, address: string): Promise<Conn> {
const builder = new flatbuffers.Builder();
const network_ = builder.createString(network);
const address_ = builder.createString(address);
fbs.Dial.startDial(builder);
fbs.Dial.addNetwork(builder, network_);
fbs.Dial.addAddress(builder, address_);
const msg = fbs.Dial.endDial(builder);
const baseRes = await dispatch.sendAsync(builder, fbs.Any.Dial, msg);
msg.Dial.startDial(builder);
msg.Dial.addNetwork(builder, network_);
msg.Dial.addAddress(builder, address_);
const inner = msg.Dial.endDial(builder);
const baseRes = await dispatch.sendAsync(builder, msg.Any.Dial, inner);
assert(baseRes != null);
assert(fbs.Any.NewConn === baseRes!.msgType());
const res = new fbs.NewConn();
assert(baseRes!.msg(res) != null);
assert(msg.Any.NewConn === baseRes!.innerType());
const res = new msg.NewConn();
assert(baseRes!.inner(res) != null);
return new ConnImpl(res.rid(), res.remoteAddr()!, res.localAddr()!);
}

View file

@ -2,7 +2,7 @@
import * as msg from "gen/msg_generated";
import { flatbuffers } from "flatbuffers";
import * as dispatch from "./dispatch";
import { FileInfo, FileInfoImpl } from "./fileinfo";
import { FileInfo, FileInfoImpl } from "./file_info";
import { assert } from "./util";
/**

View file

@ -3,7 +3,7 @@ import * as msg from "gen/msg_generated";
import { flatbuffers } from "flatbuffers";
import * as dispatch from "./dispatch";
import { assert } from "./util";
import { FileInfo, FileInfoImpl } from "./fileinfo";
import { FileInfo, FileInfoImpl } from "./file_info";
/**
* Queries the file system for information on the path provided.

View file

@ -600,8 +600,8 @@ fn op_close(
data: &'static mut [u8],
) -> Box<Op> {
assert_eq!(data.len(), 0);
let msg = base.msg_as_close().unwrap();
let rid = msg.rid();
let inner = base.inner_as_close().unwrap();
let rid = inner.rid();
match resources::lookup(rid) {
None => odd_future(errors::new(
errors::ErrorKind::BadFileDescriptor,
@ -1039,10 +1039,10 @@ fn op_listen(
}
let cmd_id = base.cmd_id();
let msg = base.msg_as_listen().unwrap();
let network = msg.network().unwrap();
let inner = base.inner_as_listen().unwrap();
let network = inner.network().unwrap();
assert_eq!(network, "tcp");
let address = msg.address().unwrap();
let address = inner.address().unwrap();
Box::new(futures::future::result((move || {
// TODO properly parse addr
@ -1052,7 +1052,7 @@ fn op_listen(
let resource = resources::add_tcp_listener(listener);
let builder = &mut FlatBufferBuilder::new();
let msg = msg::ListenRes::create(
let inner = msg::ListenRes::create(
builder,
&msg::ListenResArgs {
rid: resource.rid,
@ -1063,8 +1063,8 @@ fn op_listen(
cmd_id,
builder,
msg::BaseArgs {
msg: Some(msg.as_union_value()),
msg_type: msg::Any::ListenRes,
inner: Some(inner.as_union_value()),
inner_type: msg::Any::ListenRes,
..Default::default()
},
))
@ -1076,7 +1076,7 @@ fn new_conn(cmd_id: u32, tcp_stream: TcpStream) -> OpResult {
// TODO forward socket_addr to client.
let builder = &mut FlatBufferBuilder::new();
let msg = msg::NewConn::create(
let inner = msg::NewConn::create(
builder,
&msg::NewConnArgs {
rid: tcp_stream_resource.rid,
@ -1087,8 +1087,8 @@ fn new_conn(cmd_id: u32, tcp_stream: TcpStream) -> OpResult {
cmd_id,
builder,
msg::BaseArgs {
msg: Some(msg.as_union_value()),
msg_type: msg::Any::NewConn,
inner: Some(inner.as_union_value()),
inner_type: msg::Any::NewConn,
..Default::default()
},
))
@ -1105,8 +1105,8 @@ fn op_accept(
}
let cmd_id = base.cmd_id();
let msg = base.msg_as_accept().unwrap();
let server_rid = msg.rid();
let inner = base.inner_as_accept().unwrap();
let server_rid = inner.rid();
match resources::lookup(server_rid) {
None => odd_future(errors::new(
@ -1135,10 +1135,10 @@ fn op_dial(
}
let cmd_id = base.cmd_id();
let msg = base.msg_as_dial().unwrap();
let network = msg.network().unwrap();
let inner = base.inner_as_dial().unwrap();
let network = inner.network().unwrap();
assert_eq!(network, "tcp");
let address = msg.address().unwrap();
let address = inner.address().unwrap();
// TODO properly parse addr
let addr = SocketAddr::from_str(address).unwrap();