diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2019-02-13 02:08:56 +1100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-02-12 10:08:56 -0500 |
commit | a21a5ad2fa4dcbad58fe63c298c69f8607705bf4 (patch) | |
tree | 03e0092f46813ffdf84f53ab58f71b8a0276207e /js/make_temp_dir.ts | |
parent | 1e5e091cb074896c7550b1b6f802582f12629048 (diff) |
Add Deno global namespace (#1748)
Resolves #1705
This PR adds the Deno APIs as a global namespace named `Deno`. For backwards
compatibility, the ability to `import * from "deno"` is preserved. I have tried
to convert every test and internal code the references the module to use the
namespace instead, but because I didn't break compatibility I am not sure.
On the REPL, `deno` no longer exists, replaced only with `Deno` to align with
the regular runtime.
The runtime type library includes both the namespace and module. This means it
duplicates the whole type information. When we remove the functionality from the
runtime, it will be a one line change to the library generator to remove the
module definition from the type library.
I marked a `TODO` in a couple places where to remove the `"deno"` module, but
there are additional places I know I didn't mark.
Diffstat (limited to 'js/make_temp_dir.ts')
-rw-r--r-- | js/make_temp_dir.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/js/make_temp_dir.ts b/js/make_temp_dir.ts index 4e9b45745..1ee095bbc 100644 --- a/js/make_temp_dir.ts +++ b/js/make_temp_dir.ts @@ -12,9 +12,8 @@ export interface MakeTempDirOptions { /** makeTempDirSync is the synchronous version of `makeTempDir`. * - * import { makeTempDirSync } from "deno"; - * const tempDirName0 = makeTempDirSync(); - * const tempDirName1 = makeTempDirSync({ prefix: 'my_temp' }); + * const tempDirName0 = Deno.makeTempDirSync(); + * const tempDirName1 = Deno.makeTempDirSync({ prefix: 'my_temp' }); */ export function makeTempDirSync(options: MakeTempDirOptions = {}): string { return res(dispatch.sendSync(...req(options))); @@ -28,9 +27,8 @@ export function makeTempDirSync(options: MakeTempDirOptions = {}): string { * same directory. It is the caller's responsibility to remove the directory * when no longer needed. * - * import { makeTempDir } from "deno"; - * const tempDirName0 = await makeTempDir(); - * const tempDirName1 = await makeTempDir({ prefix: 'my_temp' }); + * const tempDirName0 = await Deno.makeTempDir(); + * const tempDirName1 = await Deno.makeTempDir({ prefix: 'my_temp' }); */ export async function makeTempDir( options: MakeTempDirOptions = {} |