mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 05:04:48 +00:00
fix(std/node/process): env, argv exports (#6455)
The promise approach still required permissions to be specified
at initialisation, rather than at request.
Using a Proxy instance solves this permission issue.
The Proxy instance approach also eliminates the need for the
await. Achieving direct compatibility with Node.js.
/ref pr #6392
/ref commit d16337cc9c
This commit is contained in:
parent
7ea3071db5
commit
16038b8f82
2 changed files with 32 additions and 27 deletions
|
@ -102,9 +102,9 @@ Deno.test({
|
|||
|
||||
Deno.test({
|
||||
name: "process.argv",
|
||||
async fn() {
|
||||
fn() {
|
||||
assert(Array.isArray(process.argv));
|
||||
assert(Array.isArray(await argv));
|
||||
assert(Array.isArray(argv));
|
||||
assert(
|
||||
process.argv[0].match(/[^/\\]*deno[^/\\]*$/),
|
||||
"deno included in the file name of argv[0]"
|
||||
|
@ -115,8 +115,8 @@ Deno.test({
|
|||
|
||||
Deno.test({
|
||||
name: "process.env",
|
||||
async fn() {
|
||||
fn() {
|
||||
assertEquals(typeof process.env.PATH, "string");
|
||||
assertEquals(typeof (await env).PATH, "string");
|
||||
assertEquals(typeof env.PATH, "string");
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue