profile
viewpoint

denoland/deno 46621

A secure JavaScript and TypeScript runtime

ry/tensorflow-resnet 1509

ResNet model in TensorFlow

ry/tensorflow-vgg16 648

conversation of caffe vgg16 model to tensorflow

ry/deno 273

ry/deno_typescript 30

To generate snapshots of TypeScript files during build.rs

ry/eecs151 12

http://inst.eecs.berkeley.edu/~eecs151/fa19/

ry/parcel 10

📦🚀 Blazing fast, zero configuration web application bundler

ry/awesome-deno 9

🎉A curated list of awesome things related to Deno

push eventdenoland/deno_website2

Daniel Lenksjö

commit sha 0a6d49805d82b2b6c1e0dd72371602c3ebe804df

add deno-amqp (#306)

view details

push time in 3 hours

PR merged denoland/deno_website2

add deno-amqp

https://github.com/lenkan/deno-amqp

+6 -0

0 comment

1 changed file

lenkan

pr closed time in 3 hours

push eventdenoland/deno

crowlKats

commit sha 6720a0dc02dc5a93472520e6d23ca033d7ec9d88

feat: Add File support in FormData (#4632)

view details

push time in 5 hours

PR merged denoland/deno

Add File support in FormData

fixes #4365 browsers seem to support it even though it isnt exactly part of the spec, though the spec does loosely mention it. i recommend to include this anyways as it makes using formdata just simpler when using files

+30 -5

0 comment

2 changed files

crowlKats

pr closed time in 5 hours

issue closeddenoland/deno

FormData accepts DomFileImpl

FormData currently allows a Blob to be passed (with set or append), but it doesnt error when passing a File object (internally DomFileImpl), as the only check is a instaceof Blob (and DomFileImpl extends Blob, so that will pass).

I recommend allowing the passing of DomFileImpl, as that is also what is pretty much common across browsers (even though it is not part of the spec). Else make a check that it isnt a DomFileImpl.

closed time in 5 hours

crowlKats

push eventdenoland/deno_website2

Mathieu Schimmerling

commit sha e1c1bc810853e907445362c49e0600a9fd378fb7

Add html_entities library (#305)

view details

push time in 5 hours

push eventdenoland/deno_website2

Khải

commit sha fcbe047d2c8e001eb9a3849567cf317b94cd96be

add shell_escape (#304)

view details

push time in 19 hours

PR merged denoland/deno_website2

Add my package
+7 -0

0 comment

1 changed file

KSXGitHub

pr closed time in 19 hours

issue commentdenoland/deno

Major features necessary for 1.0

@colorhook This is a goal, but we haven't put much work into making the deno crate's API useable for third parties. The deno_core crate, rather is the API we expect embedder to use. In any case, we will continue to iterate on these APIs beyond 1.0 - what we're trying to stabilize in 1.0 is the JS API.

Have a look at https://github.com/denoland/deno/tree/master/core/examples

ry

comment created time in 20 hours

push eventdenoland/deno

Andres Villegas

commit sha 2911fcc78de4624c0086e6458eff3b33465c8b5b

Enable inspector tests (#4628)

view details

push time in a day

PR merged denoland/deno

Enable inspector tests

Tests that where re-enableed -inspector_connect -inspector_pause -inspeector_port_collision I ran them several times, looks like they are not flaky anymore closes #4589

+0 -3

0 comment

1 changed file

avillega

pr closed time in a day

issue closeddenoland/deno

inspector_pause test flaky

https://github.com/denoland/deno/runs/555522900

---- inspector_pause stdout ----
target_dir D:\a\deno\deno\target\release
ws_url ws://127.0.0.1:9230/ws/32db3e15-0d08-4ee4-af90-b3f9ca5a7273
##[error]thread 'inspector_pause' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Os { code: 10054, kind: ConnectionReset, message: "An existing connection was forcibly closed by the remote host." })', cli\tests\integration_tests.rs:2076:17

closed time in a day

ry

push eventdenoland/deno_install

Brecht Carlier

commit sha 53daffe3ec2d4ed7b787ab8c7fc56b288fbf7140

Fix not working install script for PS5 (#104) Incorrect github link was used for downloading `deno` when using 'non-core' powershell

view details

push time in a day

PR merged denoland/deno_install

fix: Not working install script for PS5

Incorrect github link was used for downloading deno when using 'non-core' powershell

+1 -1

1 comment

1 changed file

ErazerBrecht

pr closed time in a day

push eventry/rusty_v8

Ryan Dahl

commit sha 3cd0f593d314a8ff6035b197e27e8947091e4ecf

re-enable mac release build

view details

push time in a day

push eventry/rusty_v8

Ryan Dahl

commit sha 07cd89db0770deea362d8edb36b42aadf30cf7f0

re-enable mac release build

view details

push time in a day

push eventry/rusty_v8

Ryan Dahl

commit sha d2268d9ac6c2d29c3b29bcd8a9c55cc2b87a8eb3

disable only mac release

view details

push time in a day

push eventry/rusty_v8

Ryan Dahl

commit sha 85f256360081daf43a07e2d261db194a15c6b0a7

Revert "disable mac builds" This reverts commit 1d1b6b44951d0fc6754efd473b21fd989d047b37.

view details

push time in a day

push eventdenoland/deno

Khải

commit sha 788a6abfd391b8899d28552a9f192d9aaee91347

fix(std/testing): formatting bigint (#4626)

view details

push time in a day

PR merged denoland/deno

std/testing/format: bigint

Format BigInt literals.

+15 -0

0 comment

2 changed files

KSXGitHub

pr closed time in a day

push eventdenoland/deno

Nayeem Rahman

commit sha faa0f520cf3ad03eef51d9a236202e181fe4ea69

doc: Improve the style guide (#4627)

view details

push time in a day

PR merged denoland/deno

doc: Improve the style guide

Update references to deno_std, add a bit more structure.

https://deno.land/std@e2f29b4/style_guide.md

+96 -83

0 comment

1 changed file

nayeemrmn

pr closed time in a day

push eventry/rusty_v8

Ryan Dahl

commit sha 1d1b6b44951d0fc6754efd473b21fd989d047b37

disable mac builds

view details

push time in a day

PR opened denoland/rusty_v8

fix: double rebuild when running ui tests
+6 -4

0 comment

1 changed file

pr created time in a day

create barnchry/rusty_v8

branch : v8_from_source2

created branch time in a day

issue commentdenoland/deno_install

PowerShell installation instructions fail

Thanks for the report.

I'm not sure what the problem is - I don't have a windows machine to test immediately - but I believe another version of the command should work:

iwr https://deno.land/x/install/install.ps1 -useb -outf install.ps1; .\install.ps1 v0.39.0
Vandivier

comment created time in a day

pull request commentdenoland/rusty_v8

android support

Awesome that you got this working.

  • Is there some way we can build and test this in github actions? https://github.com/denoland/rusty_v8/blob/master/.github/workflows/ci.yml

  • These submodules you've added ... I'm worried they will increase the package size and put us over the 10mb limit needed to publish on crates.io. Could you try running cargo package and see how big the resulting rusty_v8.crate file is?

gponsinet

comment created time in a day

push eventdenoland/deno

Lorran Rosa

commit sha b017409dcdbcaa5d3522f0efb191522240a6e757

on init create disk_cache directory if it doesn't already exists (#4617)

view details

push time in 2 days

PR merged denoland/deno

Check if location is dir at disk_cache.rs

This PR contains:

  • DiskCache::new() checks if given location exists if not creates it

  • Unit Tests

Attending #4616

+25 -1

1 comment

1 changed file

Drunpy

pr closed time in 2 days

push eventdenoland/deno

Kitson Kelly

commit sha f5274072870558973f70b7fad30c078647790d6c

clippy (#4618)

view details

push time in 2 days

PR merged denoland/deno

Linting improvements

Clippy nightly picks up quite a few redundant things, so no point in waiting to upgrade, might as well fix them now.

+1 -48

0 comment

32 changed files

kitsonk

pr closed time in 2 days

push eventdenoland/deno_website2

Stuart Rackham

commit sha 8461c957782c24ab401afbbdceaa85299f3b5846

Update Rimu (#302)

view details

push time in 2 days

PR merged denoland/deno_website2

Update Rimu
+1 -1

0 comment

1 changed file

srackham

pr closed time in 2 days

issue commentdenoland/deno

Rename deno fetch subcommand to deno build

deno cache ?

kitsonk

comment created time in 2 days

issue closeddenoland/deno

Deno.utime() errors when supplied date parameter

Given the following code:

await Deno.utime("my_file.txt", new Date(), new Date());

The process errors out on v0.38.0 with:

error: Uncaught InvalidData: invalid type: floating point 1585688574.996, expected u64

The same error is present with Deno.utimeSync() as well.

closed time in 2 days

cknight

pull request commentdenoland/deno

BUGFIX and refactor op_utime

Agreed - I will land it.

dubiousjim

comment created time in 2 days

issue commentdenoland/deno

inspector_pause test flaky

it's possible this was fixed in c0cb198114ccc2dc4fa2764d307ad985c456882a

ry

comment created time in 2 days

push eventdenoland/deno_website2

木杉

commit sha e52a7147b65864cd9b7925d83778ffdcddf53a4a

update format script (#288)

view details

push time in 2 days

PR merged denoland/deno_website2

update format script
  • to make the script work on win10, I removed '
  • prettier --write blah --check won't make ci go wrong
+7 -5

0 comment

3 changed files

zhmushan

pr closed time in 2 days

PR merged denoland/deno

feat: Expose ReadableStream and make Blob more standardized

This PR is continuation of #4396

  • Expose ReadableSteram in global scope.
  • Add data get methods to Blob
    • text(), stream(), arrayBuffer()
+137 -3

0 comment

5 changed files

keroxp

pr closed time in 2 days

PullRequestEvent

PR merged denoland/deno

Added Math.trunc to toSecondsFromEpoch to conform the result to u64.

<!-- Before submitting a PR, please read https://deno.land/std/manual.md#contributing --> The conversion to seconds from unix epoch resulted in a float but a u64 is required. I truncated the result to conform it to u64.

Fixes #4546

+52 -1

6 comments

2 changed files

parkerdgabel

pr closed time in 2 days

push eventdenoland/deno

Yusuke Sakurai

commit sha 24261744857df3cca8c9e05f07cc85c0346a6751

feat: Expose ReadableStream and make Blob more standardized (#4581) Co-authored-by: crowlkats <crowlkats@gmail.com>

view details

push time in 2 days

push eventdenoland/deno

Parker Gabel

commit sha 0db04d6a429eb498e854a5fc1ef905b87dea5e4d

fix(#4546) Added Math.trunc to toSecondsFromEpoch to conform the result to u64 (#4575)

view details

push time in 2 days

push eventdenoland/deno_website2

crowlKats

commit sha 5cda783ac8d7a47442a1a081492eaa88724a628a

add denv module (#301)

view details

push time in 2 days

pull request commentdenoland/deno

BUGFIX and refactor op_utime

Ah thank you for the explanation! We should change the name of that function if it’s just for permission checks.

dubiousjim

comment created time in 2 days

PR merged denoland/deno

v0.39.0

<!-- Before submitting a PR, please read https://deno.land/std/manual.md#contributing -->

+44 -11

0 comment

5 changed files

ry

pr closed time in 2 days

created tagdenoland/deno

tagv0.39.0

A secure JavaScript and TypeScript runtime

created time in 2 days

push eventdenoland/deno

Ryan Dahl

commit sha cb0acfe305a0f2f13773f41a038d8a919c3730ae

v0.39.0

view details

push time in 2 days

PR merged denoland/deno_website2

add denv module
+6 -0

0 comment

1 changed file

crowlKats

pr closed time in 2 days

pull request commentdenoland/deno

BUGFIX and refactor op_utime

Yes it does - all syscalls do. This is the purpose of cwd.

dubiousjim

comment created time in 2 days

PR closed denoland/deno

BUGFIX and refactor op_utime

As mentioned in a comment to #4428 after it was merged, some portion of the bug fix to op_utime, where it wasn't using resolve_from_cwd(Path::new(&args.path))?; accidentally got dropped. This resolves that.

+5 -2

3 comments

1 changed file

dubiousjim

pr closed time in 2 days

pull request commentdenoland/deno

BUGFIX and refactor op_utime

I think we should remove the resolve_from_cwd instead. These file system syscalls are already resolved from cwd.

dubiousjim

comment created time in 2 days

PR opened denoland/deno

v0.39.0

<!-- Before submitting a PR, please read https://deno.land/std/manual.md#contributing -->

+44 -11

0 comment

5 changed files

pr created time in 2 days

create barnchdenoland/deno

branch : vbump-0.39.0

created branch time in 2 days

push eventdenoland/deno

dubiousjim

commit sha a5fc505edb0f22b987c28f19b1c621b0715897ce

fix erroneous assert (#4608)

view details

push time in 2 days

push eventdenoland/deno

dubiousjim

commit sha 6f9c78979d4d7de6d96f7ae651b2c2018fec6e5f

Properly handle invalid utf8 in paths (#4609)

view details

push time in 2 days

PR merged denoland/deno

Use into_string(...) to eliminate unwraps

There are a number of lines in cli/ops/fs.rs that use unwrap(). This is fine if we're absolutely certain that the Result or Option being unwrapped can't represent a failure. But even if the code author was (once) certain, others reading (and changing) the code might not be. So it'd be best to minimize the use of these.

This PR eliminates a number of them.

+17 -11

0 comment

2 changed files

dubiousjim

pr closed time in 2 days

push eventdenoland/deno

dubiousjim

commit sha c5c3abc517a1729c2fcc0977bb1e792e06b7eb3c

adjust docs for Deno.seek (#4610)

view details

push time in 2 days

PR merged denoland/deno

Tweaks and doc comments for op_seek

This PR clarifies the return value of Deno.seek and Deno.seekSync.

It also tweaks the op_seek code for uniformity with the rest of cli/ops/fs.rs, and adds a debug! logger.

+6 -3

0 comment

2 changed files

dubiousjim

pr closed time in 2 days

push eventdenoland/deno

Bert Belder

commit sha c0cb198114ccc2dc4fa2764d307ad985c456882a

Make inspector more robust, add --inspect-brk support (#4552)

view details

push time in 2 days

push eventpiscisaureus/deno

Ryan Dahl

commit sha 7931d4085f6b048683c18ecbe02df60a04d9ebff

docs

view details

push time in 2 days

push eventpiscisaureus/deno

Ryan Dahl

commit sha 5053ae7372bce049bb19d8881a68a4d41ce5b601

comment out 'url' in get_json_metadata

view details

push time in 2 days

push eventpiscisaureus/deno

Ryan Dahl

commit sha 59d5ebdf315cbd5e2c3e00732f73b32d69a9c694

clippy / review

view details

push time in 2 days

delete branch ry/deno

delete branch : rm-media-types

delete time in 2 days

pull request commentdenoland/deno

Remove /std/media_types

Moved to https://deno.land/x/media_types/

ry

comment created time in 2 days

CommitCommentEvent

push eventdenoland/deno

Ryan Dahl

commit sha 13db64fbc6a8da68e5f6c1da59e058a1a3146054

Remove /std/media_types (#4594)

view details

push time in 2 days

PR merged denoland/deno

Remove /std/media_types

Fix #4292

+22 -8302

2 comments

7 changed files

ry

pr closed time in 2 days

issue closeddenoland/deno

media_types API is not good

The media_types API employs too much magic leading to unexpected behavior:

lookup('html');                     // 'text/html'
lookup('file.html');                // 'text/html'
lookup('path/to/file.html');        // 'text/html'

contentType('html');                // 'text/html; charset=utf-8'
contentType('file.html');           // 'text/html; charset=utf-8'
contentType('path/to/file.html');   // 'path/to/file.html' - uhh, what??

Also, the naming, while understandable for someone who knows the implementation (e.g. how the database is keyed), is a bit confusing for a newcomer:

  • lookup()? Aren't they all lookups of some type or another?
  • lookup() returns a (non-full?) "content type", which you pass to contentType() and it returns a "full" content type" ?

So many exports/functions:

  • lookup(path)
  • contentType(type)
  • extension(type)
  • charset(type)
  • extensions
  • types

A (imo) much easier to understand API would be to just expose (maybe a subset of) the database record type:

export interface MediaType {
    identifier: string,
    extensions: string[],
    charset?: string,
    compressible?: boolean
}

export function lookupByIdentifier(identifier: string): MediaType|undefined
export function lookupByExtension(path: string): MediaType|undefined

closed time in 2 days

jakajancar

PR merged denoland/deno

Minor improvements to Deno.rename

This PR contains the parts of #4590 left over after the createNew functionality is reverted. (I'll push that stuff to std/fs at some point; aiming to get cli/ settled first.)

What's here are:

  • Clarify/expand doc comments.

  • We refactor some tests to avoid repetition (functions assertDirectory and assertMissing).

  • We add tests documenting in which conditions the rename operation will succeed, and in which it will fail (and with what errors) on each of Windows and Unix. It'll be useful to be alerted if these expectations ever later change (for example, because our implementation of op_rename does).

    On Unix: moving a file to directory fails, moving a directory to a file or a non-empty directory fails. Moving a directory to any symlink (even one to an existing directory) also fails. Moving a file to a symlink overwrites the link.

    On Windows: moving a file to a directory fails, moving a directory to any directory fails. Moving a directory to a file overwrites the file.

+168 -32

0 comment

2 changed files

dubiousjim

pr closed time in 2 days

push eventry/deno

Ryan Dahl

commit sha 0ba344bbec41c1e5f80635ecc16a1248b4199358

fix

view details

push time in 2 days

push eventdenoland/deno

dubiousjim

commit sha ce02167c75c42e2e2f85a98128d70504e88da02b

Improve tests and docs for Deno.rename (#4597)

view details

push time in 2 days

Pull request review commentdenoland/deno

fix: async ops sanitizer false positives in timers

 const GREEN_OK = green("ok"); const YELLOW_IGNORED = yellow("ignored"); const disabledConsole = new Console((): void => {}); +function defer(n: number): Promise<void> {

Delay?

bartlomieju

comment created time in 2 days

Pull request review commentdenoland/deno

Make inspector more robust, add --inspect-brk support

 // https://chromedevtools.github.io/devtools-protocol/ // https://hyperandroid.com/2020/02/12/v8-inspector-from-an-embedder-standpoint/ +#![allow(clippy::option_map_unit_fn)]

Remove?

piscisaureus

comment created time in 2 days

Pull request review commentdenoland/deno

Make inspector more robust, add --inspect-brk support

 fn inspect_args<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b> {         .min_values(0)         .max_values(1)         .require_equals(true)-        .takes_value(true),+        .takes_value(true)+        .validator(inspect_arg_validate),

cool

piscisaureus

comment created time in 2 days

Pull request review commentdenoland/deno

Make inspector more robust, add --inspect-brk support

 async fn inspector_connect() {   child.kill().unwrap(); } +enum TestStep {+  StdOut(&'static str),+  WsRecv(&'static str),+  WsSend(&'static str),+}++#[tokio::test]+async fn inspector_break_on_first_line() {+  let script = deno::test_util::root_path()+    .join("cli")+    .join("tests")+    .join("inspector2.js");+  let mut child = util::deno_cmd()+    .arg("run")+    // Warning: each inspector test should be on its own port to avoid+    // conflicting with another inspector test.+    .arg("--inspect-brk=127.0.0.1:9229")+    .arg(script)+    .stdout(std::process::Stdio::piped())+    .stderr(std::process::Stdio::piped())+    .spawn()+    .unwrap();++  let stderr = child.stderr.as_mut().unwrap();+  let ws_url = extract_ws_url_from_stderr(stderr);+  let (socket, response) = tokio_tungstenite::connect_async(ws_url)+    .await+    .expect("Can't connect");+  assert_eq!(response.status(), 101); // Switching protocols.++  let (mut socket_tx, mut socket_rx) = socket.split();++  let stdout = child.stdout.as_mut().unwrap();+  let mut stdout_lines = std::io::BufReader::new(stdout).lines();++  use TestStep::*;+  let test_steps = vec![+    WsSend(r#"{"id":1,"method":"Runtime.enable"}"#),+    WsSend(r#"{"id":2,"method":"Debugger.enable"}"#),+    WsRecv(+      r#"{"method":"Runtime.executionContextCreated","params":{"context":{"id":1,"#,+    ),+    WsRecv(r#"{"id":1,"result":{}}"#),+    WsRecv(r#"{"id":2,"result":{"debuggerId":"#),+    WsSend(r#"{"id":3,"method":"Runtime.runIfWaitingForDebugger"}"#),+    WsRecv(r#"{"id":3,"result":{}}"#),+    WsRecv(r#"{"method":"Debugger.paused","#),+    WsSend(+      r#"{"id":5,"method":"Runtime.evaluate","params":{"expression":"Deno.core.print(\"hello from the inspector\\n\")","contextId":1,"includeCommandLineAPI":true,"silent":false,"returnByValue":true}}"#,+    ),+    WsRecv(r#"{"id":5,"result":{"result":{"type":"undefined"}}}"#),+    StdOut("hello from the inspector"),+    WsSend(r#"{"id":6,"method":"Debugger.resume"}"#),+    WsRecv(r#"{"id":6,"result":{}}"#),+    StdOut("hello from the script"),+  ];

Nice work

piscisaureus

comment created time in 2 days

Pull request review commentdenoland/deno

Make inspector more robust, add --inspect-brk support

 jobs:       # Always run master branch builds to completion. This allows the cache to       # stay mostly up-to-date in situations where a single job fails due to       # e.g. a flaky test.-      fail-fast:-        ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}+      fail-fast: false+      # ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}

Remove

piscisaureus

comment created time in 2 days

pull request commentdenoland/deno

Make inspector more robust, add --inspect-brk support

@piscisaureus Yes the segfault is gone now.

piscisaureus

comment created time in 2 days

push eventdenoland/deno

Andy Finch

commit sha d8f32c7eff02fb62250e06c1bb1eda95b86a52a7

remove `Send` trait requirement from the `Resource` trait (#4585)

view details

push time in 2 days

PR merged denoland/deno

remove `Send` trait requirement from the `Resource` trait

Pretty sure this isn't needed anymore.

+2 -2

0 comment

1 changed file

afinch7

pr closed time in 2 days

Pull request review commentdenoland/deno

bump dprint to 0.9.9

 pub mod version; mod web_worker; pub mod worker; +pub use dprint_plugin_typescript::swc_common;+pub use dprint_plugin_typescript::swc_ecma_ast;+pub use dprint_plugin_typescript::swc_ecma_parser;

👍

bartlomieju

comment created time in 2 days

Pull request review commentdenoland/deno

Added Math.trunc to toSecondsFromEpoch to conform the result to u64.

 unitTest(   } ); +unitTest(+  { perms: { read: true, write: true } },+  async function utimeFileDateSuccess(): Promise<void> {+    const testDir = Deno.makeTempDirSync();+    const filename = testDir + "/file.txt";+    Deno.writeFileSync(filename, new TextEncoder().encode("hello"), {+      mode: 0o666,+    });++    const atime = new Date();+    const mtime = new Date();+    await Deno.utime(filename, atime, mtime);++    const fileInfo = Deno.statSync(filename);+    // The dates must be scaled by a factored of 1000 to make them seconds+    assertFuzzyTimestampEquals(+      fileInfo.accessed,+      Math.trunc(atime.valueOf() / 1000)+    );+    assertFuzzyTimestampEquals(+      fileInfo.modified,+      Math.trunc(mtime.valueOf() / 1000)+    );+  }+);

It seems the test is included twice

parkerdgabel

comment created time in 3 days

push eventry/deno

Ryan Dahl

commit sha 83a26f4a3f3d4574e51b7e27a934678b346e40c4

Update std/http/file_server.ts Co-Authored-By: Kitson Kelly <me@kitsonkelly.com>

view details

push time in 3 days

Pull request review commentdenoland/deno

Minor improvements to Deno.rename

 unitTest(     const newpath = testDir + "/newpath";     Deno.mkdirSync(oldpath);     await Deno.rename(oldpath, newpath);-    const newPathInfo = Deno.statSync(newpath);-    assert(newPathInfo.isDirectory());+    assertDirectory(newpath);+    assertMissing(oldpath);+  }+); -    let caughtErr = false;-    let oldPathInfo;+function readFileString(filename: string): string {+  const dataRead = Deno.readFileSync(filename);+  const dec = new TextDecoder("utf-8");+  return dec.decode(dataRead);+} -    try {-      oldPathInfo = Deno.statSync(oldpath);-    } catch (e) {-      caughtErr = true;-      assert(e instanceof Deno.errors.NotFound);-    }-    assert(caughtErr);-    assertEquals(oldPathInfo, undefined);+function writeFileString(filename: string, s: string): void {+  const enc = new TextEncoder();+  const data = enc.encode(s);+  Deno.writeFileSync(filename, data, { mode: 0o666 });+}++unitTest(+  { ignore: Deno.build.os === "win", perms: { read: true, write: true } },+  function renameSyncErrorsUnix(): void {+    const testDir = Deno.makeTempDirSync();+    const oldfile = testDir + "/oldfile";+    const olddir = testDir + "/olddir";+    const emptydir = testDir + "/empty";+    const fulldir = testDir + "/dir";+    const file = fulldir + "/file";+    writeFileString(oldfile, "Hello");+    Deno.mkdirSync(olddir);+    Deno.mkdirSync(emptydir);+    Deno.mkdirSync(fulldir);+    writeFileString(file, "world");++    assertThrows(+      (): void => {+        Deno.renameSync(oldfile, emptydir);+      },+      Error,+      "Is a directory"+    );+    assertThrows(+      (): void => {+        Deno.renameSync(olddir, fulldir);+      },+      Error,+      "Directory not empty"+    );+    assertThrows(+      (): void => {+        Deno.renameSync(olddir, file);+      },+      Error,+      "Not a directory"+    );++    const fileLink = testDir + "/fileLink";+    const dirLink = testDir + "/dirLink";+    const danglingLink = testDir + "/danglingLink";+    Deno.symlinkSync(file, fileLink);+    Deno.symlinkSync(emptydir, dirLink);+    Deno.symlinkSync(testDir + "/nonexistent", danglingLink);++    assertThrows(+      (): void => {+        Deno.renameSync(olddir, fileLink);+      },+      Error,+      "Not a directory"+    );+    assertThrows(+      (): void => {+        Deno.renameSync(olddir, dirLink);+      },+      Error,+      "Not a directory"+    );+    assertThrows(+      (): void => {+        Deno.renameSync(olddir, danglingLink);+      },+      Error,+      "Not a directory"+    );++    // should succeed on Unix+    Deno.renameSync(olddir, emptydir);+    Deno.renameSync(oldfile, dirLink);+    Deno.renameSync(dirLink, danglingLink);+    assertFile(danglingLink);+    assertEquals("Hello", readFileString(danglingLink));+  }+);++unitTest(+  { ignore: Deno.build.os !== "win", perms: { read: true, write: true } },+  function renameSyncErrorsWin(): void {+    const testDir = Deno.makeTempDirSync();+    const oldfile = testDir + "/oldfile";+    const olddir = testDir + "/olddir";+    const emptydir = testDir + "/empty";+    const fulldir = testDir + "/dir";+    const file = fulldir + "/file";+    writeFileString(oldfile, "Hello");+    Deno.mkdirSync(olddir);+    Deno.mkdirSync(emptydir);+    Deno.mkdirSync(fulldir);+    writeFileString(file, "world");++    assertThrows(+      (): void => {+        Deno.renameSync(oldfile, emptydir);+      },+      Deno.errors.PermissionDenied,+      "Access is denied"+    );+    assertThrows(+      (): void => {+        Deno.renameSync(olddir, fulldir);+      },+      Deno.errors.PermissionDenied,+      "Access is denied"+    );+    assertThrows(+      (): void => {+        Deno.renameSync(olddir, emptydir);+      },+      Deno.errors.PermissionDenied,+      "Access is denied"+    );++    // should succeed on Windows+    Deno.renameSync(olddir, file);+    assertDirectory(file);

Nice tests

dubiousjim

comment created time in 3 days

Pull request review commentdenoland/deno

Minor improvements to Deno.rename

 declare namespace Deno {    *    *       Deno.renameSync("old/path", "new/path");    *-   * Throws error if attempting to rename to a directory which exists and is not-   * empty.+   * On Unix, this operation is like `mv -T` in not following symlinks at+   * either path.

On OSX mv -T doesn't exist. I'm not sure what it does. I think this sentence is overly specific - suggest removing.

dubiousjim

comment created time in 3 days

push eventry/deno

Ryan Dahl

commit sha 5c65be6b61db67299acecde6fa61cd86670fa66a

fix

view details

push time in 3 days

pull request commentdenoland/deno_lint

basic ignore directives

I think this would be better

// deno:ignore rule1
bartlomieju

comment created time in 3 days

PR merged denoland/deno_website2

Add media_types

Add media_types

+6 -0

0 comment

1 changed file

kitsonk

pr closed time in 3 days

push eventdenoland/deno_website2

Kitson Kelly

commit sha 1746388d0f12a442769b6fdab5a0691633c67015

Add media_types (#299)

view details

push time in 3 days

PR closed denoland/deno

Correct media_types API

Fix #4292

cc @kitsonk

+13 -29

4 comments

4 changed files

ry

pr closed time in 3 days

pull request commentdenoland/deno

Correct media_types API

OK then I'm going to remove media_types. I think it's better to kick this out into deno.land/x rather than support it forever https://github.com/denoland/deno/pull/4594

ry

comment created time in 3 days

PR opened denoland/deno

Remove /std/media_types

<!-- Before submitting a PR, please read https://deno.land/std/manual.md#contributing -->

+20 -8299

0 comment

6 changed files

pr created time in 3 days

create barnchry/deno

branch : rm-media-types

created branch time in 3 days

delete branch ry/deno

delete branch : revert4551

delete time in 3 days

push eventdenoland/deno

Ryan Dahl

commit sha c8fc29fcca0171166b7093d278bfbe03d970f1a5

Revert "Respond with 400 on request parse failure" (#4593) readRequest should not write a response. This reverts commit 017a611131a35ccf5dbfce6a2a665fa569e32ec1.

view details

push time in 3 days

PR merged denoland/deno

Revert "feat(std/http/server): Respond with 400 on request parse fail…

readRequest should not write a response.

This reverts commit 017a611131a35ccf5dbfce6a2a665fa569e32ec1.

<!-- Before submitting a PR, please read https://deno.land/std/manual.md#contributing --> cc @nayeemrmn @kt3k @bartlomieju ref https://github.com/denoland/deno/pull/4513

+14 -50

0 comment

4 changed files

ry

pr closed time in 3 days

more