hints_text
stringlengths
0
100k
created_at
stringlengths
20
20
repo
stringclasses
1 value
instance_id
stringlengths
18
20
issue_numbers
listlengths
1
3
base_commit
stringlengths
40
40
problem_statement
stringlengths
24
195k
version
stringclasses
89 values
patch
stringlengths
236
1.56M
pull_number
int64
338
27.4k
test_patch
stringlengths
206
10M
environment_setup_commit
stringclasses
90 values
@satyarohith Isn't this expected behavior on command line? ```shell echo 'hello' | 404 echo "Exit code:" $? deno eval "console.log('hello')" | 404 echo "Exit code:" $? # Expected output: # # bash: 404: command not found # Exit code: 127 # bash: 404: command not found # thread 'main' panicked at 'failed p...
2021-06-18T16:59:27Z
denoland/deno
denoland__deno-11039
[ "10764" ]
0cbaeca026a7d79a57c859e5e395f0d998fab5d1
cli: panics when the output is piped to a non-existent executable Steps to reproduce: ``` ➜ cat log.ts console.log("hello"); ➜ deno run log.ts | 404 zsh: command not found: 404 thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:940:9 note: run with `...
1.11
diff --git a/core/ops_builtin.rs b/core/ops_builtin.rs --- a/core/ops_builtin.rs +++ b/core/ops_builtin.rs @@ -61,10 +61,10 @@ pub fn op_print( is_err: bool, ) -> Result<(), AnyError> { if is_err { - eprint!("{}", msg); + stderr().write_all(msg.as_bytes())?; stderr().flush().unwrap(); } else { - ...
11,039
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -3158,6 +3158,29 @@ console.log("finish"); util::test_pty(args, output, input); } + #[test] + fn broken_stdout() { + let (reader, writer) = os_pipe::pi...
67c9937e6658c2be9b54cd95132a1055756e433b
2021-06-17T17:34:01Z
denoland/deno
denoland__deno-11023
[ "11019" ]
2a66d5de01b584b7138084eb427c9ac09c254986
`deno lsp` should exit when the editor process no longer exists When launching `deno lsp` it should check for the existence of the editor process every X seconds. If the editor process no longer exists, then it should exit. This could be achieved reliably via a CLI flag: ``` deno lsp --parent-pid <pid> ``` T...
1.11
diff --git a/cli/flags.rs b/cli/flags.rs --- a/cli/flags.rs +++ b/cli/flags.rs @@ -84,7 +84,9 @@ pub enum DenoSubcommand { root: Option<PathBuf>, force: bool, }, - Lsp, + Lsp { + parent_pid: Option<u32>, + }, Lint { files: Vec<PathBuf>, ignore: Vec<PathBuf>, diff --git a/cli/flags.rs b/c...
11,023
diff --git a/cli/flags.rs b/cli/flags.rs --- a/cli/flags.rs +++ b/cli/flags.rs @@ -2308,10 +2323,24 @@ mod tests { assert_eq!( r.unwrap(), Flags { - subcommand: DenoSubcommand::Lsp, + subcommand: DenoSubcommand::Lsp { parent_pid: None }, ..Flags::default() } ); + + ...
67c9937e6658c2be9b54cd95132a1055756e433b
2021-06-17T14:55:19Z
denoland/deno
denoland__deno-11020
[ "11017" ]
9105892ec8b454571c56883eace557eee25b3301
Users can set "Host" header for `fetch` The `host` header should not be able to be set by the user. It should always be populated by `reqwest` / `hyper`.
1.11
diff --git a/extensions/fetch/lib.rs b/extensions/fetch/lib.rs --- a/extensions/fetch/lib.rs +++ b/extensions/fetch/lib.rs @@ -29,6 +29,7 @@ use deno_web::BlobUrlStore; use reqwest::header::HeaderMap; use reqwest::header::HeaderName; use reqwest::header::HeaderValue; +use reqwest::header::HOST; use reqwest::header:...
11,020
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -1149,3 +1149,49 @@ unitTest({}, function fetchWritableRespProps(): void { assertEquals(original.status, new_.status); assertEquals(new_.headers.get("x-deno"), "foo"); ...
67c9937e6658c2be9b54cd95132a1055756e433b
2021-06-17T07:44:30Z
denoland/deno
denoland__deno-11015
[ "11014" ]
419fe2e6b4b77fbc97dee67eaa32a420accb8cfc
Redundant re-checking of dynamic imports ![image](https://user-images.githubusercontent.com/29990554/122350163-e1537180-cf44-11eb-8c07-8ae6b2957af3.png) You can cause the module to be type-checked again by changing the file between repeated dynamic imports, but the module is already loaded so this should not happen....
1.11
diff --git a/cli/main.rs b/cli/main.rs --- a/cli/main.rs +++ b/cli/main.rs @@ -598,6 +598,7 @@ async fn create_module_graph_and_maybe_check( lib, maybe_config_file: program_state.maybe_config_file.clone(), reload: program_state.flags.reload, + ..Default::default() })?; de...
11,015
diff --git a/cli/module_graph.rs b/cli/module_graph.rs --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -2255,6 +2265,7 @@ pub mod tests { lib: TypeLib::DenoWindow, maybe_config_file: None, reload: false, + ..Default::default() }) .expect("should have checked"); ...
67c9937e6658c2be9b54cd95132a1055756e433b
Input file(s) can be found here: https://github.com/mustakimur/crash_report/tree/main/deno/10927
2021-06-16T12:39:13Z
denoland/deno
denoland__deno-11007
[ "10927" ]
4f1b1903cfadeeba24e1b0448879fe12682effb9
'attempt to multiply with overflow' in swc_ecma_parser crate Input that causes the overflow: ``` \u{cccccccccsccccccQcXt[uc(~).const[uctor().const[uctor())tbr()) ``` The error reported: ``` thread 'main' panicked at 'attempt to multiply with overflow', /home/diane/.cargo/registry/src/github.com-1ecc6299db9ec823/s...
1.11
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -652,9 +652,9 @@ dependencies = [ [[package]] name = "deno_doc" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22f258ef461d9f5b04703d1510137fa9c09f128a5b4fb51fc665d9dd841c...
11,007
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -3351,9 +3351,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.18.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a54a3a2942b8a0031ee5f40695553a6096273803...
67c9937e6658c2be9b54cd95132a1055756e433b
Will fix this in an upcoming PR.
2021-06-16T12:35:40Z
denoland/deno
denoland__deno-11006
[ "11004" ]
8e4a70c7e9e495ca425bb29cafe1f426ad29c406
Style guide should encourage code example in comments With support for running type checking on code block examples in Jsdoc comments, we should upgrade the style guide accordingly.
1.11
diff --git a/docs/contributing/style_guide.md b/docs/contributing/style_guide.md --- a/docs/contributing/style_guide.md +++ b/docs/contributing/style_guide.md @@ -49,8 +49,7 @@ Follow Rust conventions and be consistent with existing code. ## TypeScript -The TypeScript portions of the codebase include `cli/js` for ...
11,006
diff --git a/docs/contributing/style_guide.md b/docs/contributing/style_guide.md --- a/docs/contributing/style_guide.md +++ b/docs/contributing/style_guide.md @@ -296,9 +294,8 @@ problems, but it should be used scarcely. ### Each module should come with a test module. Every module with public functionality `foo.ts`...
67c9937e6658c2be9b54cd95132a1055756e433b
Would love to see this too, right now it’s a jack approach to get global declarations I will be raising a PR soon that delivers this feature using the `compilerOptions.types` across all different forms of type checking we support (`Deno.emit` and the `--config tsconfig.json` forms).
2021-06-16T03:42:42Z
denoland/deno
denoland__deno-10999
[ "10677" ]
952caa79b32e6c249977281ed494d4b1f98ed451
Deno.emit: Add option for ambient type declarations This is a follow up to the discussion at https://github.com/denoland/deno/discussions/10549 I see that I can supply predefined environment enums in the emit options `compilerOptions.lib` array (e.g. `ES2017`, `DOM.Iterable`, etc.), but I don't see a way to provide ...
1.11
diff --git a/cli/build.rs b/cli/build.rs --- a/cli/build.rs +++ b/cli/build.rs @@ -163,6 +163,10 @@ fn create_compiler_snapshot( })) }), ); + js_runtime.register_op( + "op_cwd", + op_sync(move |_state, _args: Value, _: ()| Ok(json!("cache:///"))), + ); // using the same op that is used in `tsc...
10,999
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -2632,7 +2719,9 @@ mod tests { let temp_dir = TempDir::new().expect("could not create temp dir"); let location = temp_dir.path().join("deps"); let state_snapshot = mock_state_snapshot(sources, &location); - let m...
67c9937e6658c2be9b54cd95132a1055756e433b
This can actually be reproduced by just running the expression `Event.prototype` (issue is that it inspects getters that will throw an error). Will fix it soon.
2021-06-15T19:50:21Z
denoland/deno
denoland__deno-10979
[ "9880" ]
5bf4a88aa494073abd57838a60e9140062ac4e41
`Object.defineProperty` on `Event` prototype panics in repl running `Object.defineProperty(Event.prototype, 0, {})` in repl will panic with `thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', cli/tools/repl.rs:564:49`
1.11
diff --git a/extensions/web/02_event.js b/extensions/web/02_event.js --- a/extensions/web/02_event.js +++ b/extensions/web/02_event.js @@ -144,7 +144,7 @@ } [Symbol.for("Deno.customInspect")](inspect) { - return buildCustomInspectOutput(this, EVENT_PROPS, inspect); + return inspect(buildFilteredPr...
10,979
diff --git a/cli/tests/unit/event_test.ts b/cli/tests/unit/event_test.ts --- a/cli/tests/unit/event_test.ts +++ b/cli/tests/unit/event_test.ts @@ -1,5 +1,10 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals, unitTest } from "./test_util.ts"; +import { + asser...
67c9937e6658c2be9b54cd95132a1055756e433b
2021-06-15T18:44:55Z
denoland/deno
denoland__deno-10977
[ "10975" ]
0c0058f1181d1fd6590f760a0375ead706043d32
Inspecting a proxy with `showProxy: false` incorrectly inspects the target The code in 02_console.js does not seem to properly inspect any object that's a proxy when `showProxy: false` (default) and instead inspects the target of the proxy. For example: ```ts const myObject = new Proxy({}, { get(_target, key)...
1.11
diff --git a/extensions/console/02_console.js b/extensions/console/02_console.js --- a/extensions/console/02_console.js +++ b/extensions/console/02_console.js @@ -429,10 +429,8 @@ inspectOptions, ) { const proxyDetails = core.getProxyDetails(value); - if (proxyDetails != null) { - return inspectOpt...
10,977
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -1737,16 +1737,40 @@ unitTest(function inspectIterableLimit(): void { unitTest(function inspectProxy(): void { assertEquals( stripColor(Deno.inspect( - ...
67c9937e6658c2be9b54cd95132a1055756e433b
2021-06-14T18:36:23Z
denoland/deno
denoland__deno-10963
[ "10962" ]
c651757fb7a1f6cec94c3857973d3316129bccb8
REPL does not complete declarations For example... ``` > const myVar = {}; undefined > my<TAB> ``` ...does nothing. I'm not sure if this is a bug or a feature that just hasn't been done so please categorize accordingly.
1.11
diff --git a/cli/tools/repl.rs b/cli/tools/repl.rs --- a/cli/tools/repl.rs +++ b/cli/tools/repl.rs @@ -50,47 +50,34 @@ impl EditorHelper { self.message_tx.send((method.to_string(), params))?; self.response_rx.recv()? } -} - -fn is_word_boundary(c: char) -> bool { - if c == '.' { - false - } else { - ...
10,963
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2085,6 +2085,35 @@ mod integration { } } + #[cfg(unix)] + #[test] + fn pty_complete_declarations() { + use std::io::Read; + use util...
67c9937e6658c2be9b54cd95132a1055756e433b
Yeah - I only added `harnessStatus` a few days ago. It should be taken into account when reporting status too. The easiest and likely most logical fix would be to rethrow the error return value of `Deno.core.evalContext` in parent scope. This should cause the process to exit with a non 0 status code. This would align w...
2021-06-11T13:51:31Z
denoland/deno
denoland__deno-10932
[ "10930" ]
1a92c39b77c46170a2135994359962034c8131c5
The WPT test runner doesn't detect exceptions thrown outside tests While trying a few things related to workers on WPT (see #10903), I noticed that the `.any.worker.html` tests were reported as succeeding, even though they were using classic workers, which Deno doesn't support. This seems to be because the main script ...
1.11
diff --git a/tools/wpt/runner.ts b/tools/wpt/runner.ts --- a/tools/wpt/runner.ts +++ b/tools/wpt/runner.ts @@ -168,9 +168,13 @@ async function generateBundle(location: URL): Promise<string> { } } - return scriptContents.map(([url, contents]) => - `Deno.core.evalContext(${JSON.stringify(contents)}, ${ - ...
10,932
diff --git a/test_util/wpt b/test_util/wpt --- a/test_util/wpt +++ b/test_util/wpt @@ -1,1 +1,1 @@ -Subproject commit e664d8ccb0a25bb28b3e027bce6817e9108845e0 +Subproject commit 146f12e8df2cac6b1e60152145124a81dad60d38 diff --git a/tools/wpt/testharnessreport.js b/tools/wpt/testharnessreport.js --- a/tools/wpt/testharn...
67c9937e6658c2be9b54cd95132a1055756e433b
I will open a PR that removes all code related to plugins in the near future so we could evaluate its impact on the codebase. PR for reference https://github.com/denoland/deno/pull/8493 What does "Rust scaffold" means? Like a template for developing plugins or a library that can be used to integrate with Deno? Native p...
2021-06-09T15:26:24Z
denoland/deno
denoland__deno-10908
[ "8490" ]
622f9c688902411e347038e82fc5c354c60678cf
Remove unstable native plugins Opening this issue to start discussion on potential removal of native plugins. Native plugins are an unstable feature that hasn't seen much adoption; partially due to lack of documentation and partially due to shortcomings of plugin interface. Currently there's one major problem th...
1.11
diff --git a/runtime/js/40_plugins.js /dev/null --- a/runtime/js/40_plugins.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -"use strict"; - -((window) => { - const core = window.Deno.core; - - function openPlugin(filename) { - const rid = core.opSync("...
10,908
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -3550,16 +3550,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "test_plugin" -version = "0.0.1" -dependencies = [ - "deno_core", - "futures", - "serde", - "test_util", -] - [[package]] name = "test_util" version = "0.1.0" diff...
67c9937e6658c2be9b54cd95132a1055756e433b
For whoever wants to fix this: For `Deno.ppid` and `Deno.memoryUsage` you need to move the type declarations from `deno.unstable` to `deno.ns` lib. For `Deno.sleepSync` you need to move [this line](https://github.com/denoland/deno/blob/875ac73f1e8459ecec3d0d7b275546740bfe007e/runtime/js/90_deno_ns.js#L88) to the...
2021-06-07T11:34:15Z
denoland/deno
denoland__deno-10880
[ "10827" ]
a5eb2dfc93afc2899ed6e1ad2b3e029157889f7c
stable/unstable documentation vs implementation discrepancy The following Deno APIs are documented as unstable, but are available in stable: * `Deno.ppid` * `Deno.memoryUsage` * `Deno.sleepSync` On the other hand, the following Deno APIs are documented as stable, but is only available in unstable: * `Deno.sh...
1.11
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -90,6 +90,24 @@ declare namespace Deno { /** The current process id of the runtime. */ export const pid: number; + /** + * The pid of the current process's parent. + */ + expor...
10,880
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -628,45 +628,4 @@ mod tests { let actual = diagnostics.to_string(); assert_eq!(strip_ansi_codes(&actual), "TS2552 [ERROR]: Cannot find name \'foo_Bar\'. Did you mean \'foo_bar\'?\nfoo_Bar();\n~~~~~~~\n ...
67c9937e6658c2be9b54cd95132a1055756e433b
Have also run into this before. We need to invalidate diagnostics on all files that reference the changed file. Doesn't seem like we do that at the moment. Yeah, I have run into it too. Need to think about how we can invalidate open files that depend on a file that changes. I think I know what we need to do.
2021-06-02T04:53:12Z
denoland/deno
denoland__deno-10817
[ "10775" ]
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
lsp: files dependent on changed file don't update diagnostics **Describe the bug** When an object in a different file gets changed it gets updated slowly or even never in other files. **To Reproduce** 1. Create 2 files 2. In one file create an object like ```ts export const foo = { foo: "bar", } ``` 3. ...
1.10
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -120,8 +120,11 @@ impl DiagnosticsServer { .collect() } - pub(crate) async fn invalidate(&self, specifier: &ModuleSpecifier) { - self.collection.lock().await.versions.remove(specifie...
10,817
diff --git a/cli/tests/integration_tests_lsp.rs b/cli/tests/integration_tests_lsp.rs --- a/cli/tests/integration_tests_lsp.rs +++ b/cli/tests/integration_tests_lsp.rs @@ -1994,6 +1994,145 @@ fn lsp_diagnostics_deno_types() { shutdown(&mut client); } +#[cfg(not(windows))] +#[test] +fn lsp_diagnostics_refresh_depen...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
2021-06-02T01:39:08Z
denoland/deno
denoland__deno-10816
[ "10815" ]
9ae8dbf17334f1cf7ae09abf585d8797f374bdc4
lsp: Hover info and completions in markdown files Since 1.10.3 and VSC extension 3.5.0, I am getting hover info, completions, semantic highlighting and some other stuff from the deno TS service in markdown files.
1.10
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -178,33 +178,7 @@ pub fn map_content_type( if let Some(content_type) = maybe_content_type { let mut content_types = content_type.split(';'); let content_type = content_types.next().unwrap(); - l...
10,816
diff --git a/cli/lsp/completions.rs b/cli/lsp/completions.rs --- a/cli/lsp/completions.rs +++ b/cli/lsp/completions.rs @@ -559,6 +559,7 @@ mod tests { use crate::http_cache::HttpCache; use crate::lsp::analysis; use crate::lsp::documents::DocumentCache; + use crate::lsp::documents::LanguageId; use crate::ls...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
2021-05-31T15:19:50Z
denoland/deno
denoland__deno-10804
[ "10795" ]
ea2c7ac5566e6973cdd68aaa8aa3dcb8c51a5865
`deno cache` does not fail on bare imports ```ts // deno cache import "foo"; ``` Completes successfully.
1.10
diff --git a/cli/module_graph.rs b/cli/module_graph.rs --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -38,6 +38,7 @@ use deno_core::serde::Serialize; use deno_core::serde::Serializer; use deno_core::serde_json::json; use deno_core::serde_json::Value; +use deno_core::url::Url; use deno_core::ModuleResolution...
10,804
diff --git /dev/null b/cli/tests/095_cache_with_bare_import.ts.out new file mode 100644 --- /dev/null +++ b/cli/tests/095_cache_with_bare_import.ts.out @@ -0,0 +1,1 @@ +[WILDCARD]error: Relative import path "foo" not prefixed with / or ./ or ../ from "file:///[WILDCARD]/095_cache_with_bare_import.ts" diff --git a/cli/t...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
Do you use any dynamic imports? @satyarohith No, it can point a directory too, thats the whole point of the import maps @lucacasonato I do, yes, all of them don't use bare specifiers though. Do any of the files that are dynamically imported have bare specifiers? @lucacasonato Nope Ok let me rephrase, do any of the m...
2021-05-31T13:23:55Z
denoland/deno
denoland__deno-10801
[ "10616", "9415", "9932" ]
330cd6b7ea46524783e5d1a8654153b459931cd7
Adding `--import-map` breaks the code I have code that works fine without import maps: ``` nickolay@frontier:~/workspace/Bryntum/siesta-monorepo/siesta$ deno run -A --unstable --quiet tests/hook/hook.t.js Launching test file: tests/hook/hook.t.js in Deno 1.9.2 PASS tests/hook/hook.t.js Test files : 1 passed,...
1.10
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -521,7 +521,7 @@ dependencies = [ [[package]] name = "deno" -version = "1.10.2" +version = "1.10.3" dependencies = [ "atty", "base64 0.13.0", diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -615,14 +615,14 @@ de...
10,801
diff --git a/Releases.md b/Releases.md --- a/Releases.md +++ b/Releases.md @@ -6,6 +6,50 @@ https://github.com/denoland/deno/releases We also have one-line install commands at: https://github.com/denoland/deno_install +### 1.10.3 / 2021.05.31 + +- feat(lsp): diagnostics for deno types and triple-slash refs (#10699)...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
I couldn't reproduce this bug on `1.10.2` and on canary: ``` Starting Deno language server... version: 1.10.2 (release, x86_64-apple-darwin) Connected to "Visual Studio Code" 1.56.2 Updating TypeScript configuration from: "./deno.tsconfig.json" language server initialized Server ready. ``` ``` Starting Deno...
2021-05-29T19:35:45Z
denoland/deno
denoland__deno-10791
[ "10747" ]
76d343002e0727b59b75e91cb5de9dbd292451b9
Updating tsconfig has errored: Failed to load configuration file ### Reproducible steps 1. Prepare the following environment. ``` > systeminfo OS Name: Microsoft Windows 10 Pro N OS Version: 10.0.19042 N/A Build 19042 > code --version 1.56.2 054a9295330880ed74ceaedda236253b4f3...
1.10
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -441,7 +441,15 @@ impl Inner { )) }?; - let config_file = ConfigFile::read(config_url.path())?; + let config_file = { + let buffer = config_url + ...
10,791
diff --git a/cli/tests/integration_tests_lsp.rs b/cli/tests/integration_tests_lsp.rs --- a/cli/tests/integration_tests_lsp.rs +++ b/cli/tests/integration_tests_lsp.rs @@ -31,7 +31,10 @@ fn init(init_path: &str) -> LspClient { client } -fn did_open<V>(client: &mut LspClient, params: V) +fn did_open<V>( + client: ...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
2021-05-28T11:59:18Z
denoland/deno
denoland__deno-10778
[ "10765" ]
76e2edc7e1868d7768e259aacbb9a991e1afc462
lsp: Local imports through code action are missing .ts extension This plugin is mostly doing pretty incredible, I've been having a small issue with imports the past few weeks. Given two files: `dep.ts` ```ts export const age = 28; ``` and `main.ts` ```ts console.log(age); ``` The LSP gives a helpful action...
1.10
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -11,6 +11,7 @@ use crate::module_graph::parse_ts_reference; use crate::module_graph::TypeScriptReference; use crate::tools::lint::create_linter; +use deno_core::error::anyhow; use deno_core::error::custom_...
10,778
diff --git a/cli/tests/integration_tests_lsp.rs b/cli/tests/integration_tests_lsp.rs --- a/cli/tests/integration_tests_lsp.rs +++ b/cli/tests/integration_tests_lsp.rs @@ -1425,6 +1425,57 @@ fn lsp_code_actions_deno_cache() { shutdown(&mut client); } +#[test] +fn lsp_code_actions_imports() { + let mut client = in...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
Still broken in 1.10.2 - different line in `23_request.js`, but same basic issue. ``` deno 1.10.2 (release, x86_64-apple-darwin) v8 9.1.269.27 typescript 4.2.2 ``` ``` error: Uncaught (in promise) TypeError: This property is not implemented. const reqCopy = new Request(request.url, request); //...
2021-05-26T14:10:48Z
denoland/deno
denoland__deno-10769
[ "10355" ]
02a4e7dc7cce4df8f2e8e69d3aa4e2eed22e627d
Cloning a request with an additional property throws an unrelated error in 1.9.2 – 1.10.2 Note this only happens when the source request is in the `RequestInit` position (see below). I found #10286, but this situation really has nothing to do with `request.cache`, the clone should succeed, and later throw if and onl...
1.10
diff --git a/extensions/fetch/22_body.js b/extensions/fetch/22_body.js --- a/extensions/fetch/22_body.js +++ b/extensions/fetch/22_body.js @@ -147,6 +147,8 @@ return this[bodySymbol].stream; } }, + configurable: true, + enumerable: true, }, bodyUsed: { ...
10,769
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -1139,3 +1139,13 @@ unitTest( assertEquals(actual, expected); }, ); + +unitTest({}, function fetchWritableRespProps(): void { + const original = new Response("https...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
It would be consistent if the error was reported in the `EmitResult` somewhere instead of being thrown. I tried doing the same thing with `Deno.info()` in #10758's branch and got an error value: ```js { // ... modules: [ // ... { specifier: "https://deno.land/std@0.97.0/path/mod.ts", dep...
2021-05-26T04:00:41Z
denoland/deno
denoland__deno-10767
[ "10761" ]
afe89e8850d9ca2adcf73c8d2d63f5054a594878
`Deno.emit()` without net permission silently excludes remote dependencies As of 1.10.2, having fixed GHSA-xpwj-7v8q-mcgj, `Deno.emit()` will no longer fetch transitive remote dependencies without net permission. The following code silently excludes the remote dependency from the emit instead of throwing a permission e...
1.11
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -6,7 +6,9 @@ use deno_core::serde::Deserialize; use deno_core::serde::Deserializer; use deno_core::serde::Serialize; use deno_core::serde::Serializer; +use deno_core::ModuleSpecifier; use regex::Regex; +use std...
10,767
diff --git a/cli/tests/compiler_api_test.ts b/cli/tests/compiler_api_test.ts --- a/cli/tests/compiler_api_test.ts +++ b/cli/tests/compiler_api_test.ts @@ -406,3 +406,49 @@ Deno.test({ assert(files["deno:///bundle.js.map"]); }, }); + +Deno.test({ + name: `Deno.emit() - graph errors as diagnostics`, + ignore: ...
67c9937e6658c2be9b54cd95132a1055756e433b
2021-05-21T09:20:05Z
denoland/deno
denoland__deno-10734
[ "10733" ]
e5beb800c94099852964d482a32a13f5c29ec147
Error while parsing empty tsconfig.json Hi :) While trying to run deno using: `deno run -c tsconfig.json main.js` I got: ``` thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', cli/config_file.rs:290:59 ``` The Error happens with a fully commented tsconfig.json file or an empty one. ###...
1.10
diff --git a/cli/config_file.rs b/cli/config_file.rs --- a/cli/config_file.rs +++ b/cli/config_file.rs @@ -1,6 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. use crate::fs_util::canonicalize_path; +use deno_core::error::anyhow; use deno_core::error::AnyError; use deno_core::err...
10,734
diff --git a/cli/config_file.rs b/cli/config_file.rs --- a/cli/config_file.rs +++ b/cli/config_file.rs @@ -393,6 +410,42 @@ mod tests { ); } + #[test] + fn test_parse_config_with_empty_file() { + let config_text = ""; + let config_path = PathBuf::from("/deno/tsconfig.json"); + let config_file = Con...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
2021-05-19T07:12:45Z
denoland/deno
denoland__deno-10699
[ "9823" ]
6044b037fb3efd638e599f39da2b28f53c915319
Support import completions + cache quick fix in @deno-types and triple slash Follow up to #9821 We should support the cache quick fix, import diagnostics, and import completions for import specifiers in `// @deno-types=""` and `/// <references types="" />` comments, like we did in the old extension.
1.10
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -140,6 +140,7 @@ pub struct Dependency { pub maybe_code: Option<ResolvedDependency>, pub maybe_code_specifier_range: Option<Range>, pub maybe_type: Option<ResolvedDependency>, + pub maybe_type_specifi...
10,699
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -723,6 +775,16 @@ mod tests { character: 58, } }), + maybe_type_specifier_range: Some(Range { + start: Position { + line: 7, + character: 2...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
2021-05-19T04:08:44Z
denoland/deno
denoland__deno-10696
[ "10695" ]
7cf674d4111b0c9e21f2dcba0dcfd8213573fa5f
lsp: code actions to cache imports are missing There was a regression in 1.10 in the lsp where code actions for caching missing imports was missing from responses. This is due to the restructuring of the way diagnostics are stored, and only analysing if TypeScript diagnostics are fixable or not. I am working on a f...
1.10
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -11,6 +11,7 @@ use crate::tokio_util::create_basic_runtime; use deno_core::error::anyhow; use deno_core::error::AnyError; use deno_core::resolve_url; +use deno_core::serde_json::json; use deno_c...
10,696
diff --git a/cli/tests/integration_tests_lsp.rs b/cli/tests/integration_tests_lsp.rs --- a/cli/tests/integration_tests_lsp.rs +++ b/cli/tests/integration_tests_lsp.rs @@ -1362,17 +1362,24 @@ fn lsp_code_actions() { #[test] fn lsp_code_actions_deno_cache() { let mut client = init("initialize_params.json"); - did_o...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
2021-05-18T15:27:10Z
denoland/deno
denoland__deno-10689
[ "10688" ]
bdee065d424f4dcc45c9137ccd1d0d9e581d20ae
http: responding with empty blob causes unreachable error The following http server stops with an uncaught type error: ```ts for await (const conn of Deno.listen({ port: 3000 })) { (async () => { for await (const { respondWith } of Deno.serveHttp(conn)) { respondWith(new Response(new Blob([""]))); ...
1.10
diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js --- a/runtime/js/40_http.js +++ b/runtime/js/40_http.js @@ -132,10 +132,13 @@ } else { const reader = innerResp.body.stream.getReader(); const r1 = await reader.read(); - if (r1.done) throw new TypeError("Unreacha...
10,689
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts --- a/cli/tests/unit/http_test.ts +++ b/cli/tests/unit/http_test.ts @@ -317,3 +317,25 @@ unitTest( await promise; }, ); + +unitTest( + { perms: { net: true } }, + async function httpServerEmptyBlobResponse() { + const promise = (async ...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
2021-05-18T05:19:10Z
denoland/deno
denoland__deno-10680
[ "9932" ]
8ffeabc678dc33932ba71273fa2dc9d787274880
lsp: "X-Deno-Warning" should appear as a diagnostic Currently in the lsp, when a file is fetched with `X-Deno-Warning` it is logged to the Deno Language Server output, but it should be a diagnostic message on the appropriate specifier.
1.10
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -432,13 +432,21 @@ async fn generate_deps_diagnostics( range, severity: Some(lsp::DiagnosticSeverity::Error), code, - ...
10,680
diff --git a/cli/lsp/sources.rs b/cli/lsp/sources.rs --- a/cli/lsp/sources.rs +++ b/cli/lsp/sources.rs @@ -547,6 +567,23 @@ mod tests { assert_eq!(actual, Some((specifier_type, MediaType::Dts))) } + #[test] + fn test_warning_header() { + let (sources, location) = setup(); + let cache = HttpCache::new(...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
Also a quick fix to add a file level ignore would be great. Yeah, there is logic around "fix all" which means we could send the single one and a bundle up duplicates in the same file with a "fix all" quick fix that adds it to the top... picking the right place will be the "challenge" in this, as it takes some quite com...
2021-05-13T10:09:31Z
denoland/deno
denoland__deno-10627
[ "10122" ]
bbc2745350687f209c6af75958cc12bb43e64042
lsp: lint diagnostics should have a quick fix to add ignore comment Lint diagnostics in the LSP should produce a code action quick fix that inserts a comment to ignore the lint rule. For example, the following: ```ts declare var a: any; ``` Which generates the diagnostic: ``` `any` type is not allowed d...
1.11
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -5,6 +5,7 @@ use super::tsc; use crate::ast; use crate::import_map::ImportMap; +use crate::lsp::documents::DocumentData; use crate::media_type::MediaType; use crate::module_graph::parse_deno_types; use c...
10,627
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -833,6 +936,18 @@ impl CodeActionCollection { } } +/// Prepend the whitespace characters found at the start of line_content to content. +fn prepend_whitespace(content: String, line_content: Option<String>...
67c9937e6658c2be9b54cd95132a1055756e433b
2021-05-12T18:30:24Z
denoland/deno
denoland__deno-10620
[ "10619" ]
62c752211c982ee6eb297cf49a076464471407f7
deno.config path is loaded with duplicate cwd Setting "deno.config" to "./tsconfig" in `settings.json` results in the lsp server appending the current working directory twice.
1.10
diff --git a/cli/config_file.rs b/cli/config_file.rs --- a/cli/config_file.rs +++ b/cli/config_file.rs @@ -270,9 +270,14 @@ pub struct ConfigFile { } impl ConfigFile { - pub fn read(path: &str) -> Result<Self, AnyError> { - let cwd = std::env::current_dir()?; - let config_file = cwd.join(path); + pub fn rea...
10,620
diff --git a/cli/config_file.rs b/cli/config_file.rs --- a/cli/config_file.rs +++ b/cli/config_file.rs @@ -318,12 +323,22 @@ mod tests { use deno_core::serde_json::json; #[test] - fn read_config_file() { + fn read_config_file_relative() { let config_file = ConfigFile::read("tests/module_graph/tsconfig.js...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
Do you use any dynamic imports? @satyarohith No, it can point a directory too, thats the whole point of the import maps @lucacasonato I do, yes, all of them don't use bare specifiers though. Do any of the files that are dynamically imported have bare specifiers? @lucacasonato Nope Ok let me rephrase, do any of the m...
2021-05-12T18:29:44Z
denoland/deno
denoland__deno-10618
[ "10616" ]
83ce33363347447e25d2d00732dad86b588b89f0
Adding `--import-map` breaks the code I have code that works fine without import maps: ``` nickolay@frontier:~/workspace/Bryntum/siesta-monorepo/siesta$ deno run -A --unstable --quiet tests/hook/hook.t.js Launching test file: tests/hook/hook.t.js in Deno 1.9.2 PASS tests/hook/hook.t.js Test files : 1 passed,...
1.10
diff --git a/cli/import_map.rs b/cli/import_map.rs --- a/cli/import_map.rs +++ b/cli/import_map.rs @@ -14,11 +14,25 @@ use std::error::Error; use std::fmt; #[derive(Debug)] -pub struct ImportMapError(String); +pub enum ImportMapError { + UnmappedBareSpecifier(String, Option<String>), + Other(String), +} impl f...
10,618
diff --git a/cli/import_map.rs b/cli/import_map.rs --- a/cli/import_map.rs +++ b/cli/import_map.rs @@ -465,7 +479,6 @@ impl ImportMap { mod tests { use super::*; - use deno_core::resolve_import; use std::path::Path; use std::path::PathBuf; use walkdir::WalkDir; diff --git a/cli/import_map.rs b/cli/impor...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
cc @crowlKats An alternative to clear the Local Storage is `deno repl --location=[DOMAIN]` and then to use `localStorage.clear()`. But oddly running `deno --location=[DOMAIN]` and `echo ... | deno repl --location=[DOMAIN] --` throws error because of the `--location` flag. `deno eval --location=[DOMAIN] "localStorag...
2021-05-11T16:14:42Z
denoland/deno
denoland__deno-10589
[ "10585" ]
d5d59bb794503416ced2c3ad6a2bb043f97ce3e5
`deno info` should display the current path of the Local Storage file I think it would be a good idea to add a new item to `deno info` to display the path of the Local Storage file. It might be useful when a user wants to quickly remove it. Also good for transparency.
1.10
diff --git a/cli/flags.rs b/cli/flags.rs --- a/cli/flags.rs +++ b/cli/flags.rs @@ -791,6 +791,11 @@ TypeScript compiler cache: Subdirectory containing TS compiler output.", .arg(Arg::with_name("file").takes_value(true).required(false)) .arg(reload_arg().requires("file")) .arg(ca_file_arg()) + .arg( + ...
10,589
diff --git a/cli/tests/041_info_flag.out b/cli/tests/041_info_flag.out --- a/cli/tests/041_info_flag.out +++ b/cli/tests/041_info_flag.out @@ -2,3 +2,4 @@ DENO_DIR location: "[WILDCARD]" Remote modules cache: "[WILDCARD]deps" Emitted modules cache: "[WILDCARD]gen" Language server registries cache: "[WILDCARD]registr...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
I'd like to try and fix this pls.
2021-05-03T05:23:48Z
denoland/deno
denoland__deno-10478
[ "10476" ]
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
Non descript error when import map isnt found ``` $ deno info --import-map does_not_exist.json does_exist.js error: No such file or directory (os error 2) ``` This error should contain some context that the _import map_ isn't found.
1.9
diff --git a/cli/ops/runtime_compiler.rs b/cli/ops/runtime_compiler.rs --- a/cli/ops/runtime_compiler.rs +++ b/cli/ops/runtime_compiler.rs @@ -87,7 +87,13 @@ async fn op_emit( let file = program_state .file_fetcher .fetch(&import_map_specifier, &mut runtime_permissions) - .await?; + ...
10,478
diff --git a/cli/tests/compiler_api_test.ts b/cli/tests/compiler_api_test.ts --- a/cli/tests/compiler_api_test.ts +++ b/cli/tests/compiler_api_test.ts @@ -338,3 +338,22 @@ Deno.test({ assert(files["deno:///bundle.js"].endsWith("})();\n")); }, }); + +Deno.test({ + name: `Deno.emit() - throws descriptive error ...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
It isn't actually in the [console spec](https://console.spec.whatwg.org/), so it should probably just be removed from the types.
2021-05-01T06:54:38Z
denoland/deno
denoland__deno-10455
[ "10444" ]
c5be20aa67f9f84f5687feeff77fb09f4f05f471
`console.timeStamp` is documented but does not exist `console.timeStamp` is shown as an API in the TypeScript types, but doesn't actually exist at runtime: https://github.com/denoland/deno/blob/8922639c1dc48a8b1ed6910bfe62306d9178d70b/op_crates/console/lib.deno_console.d.ts#L26 ``` $ deno repl --unstable Deno 1.9.2...
1.9
diff --git a/extensions/console/lib.deno_console.d.ts b/extensions/console/lib.deno_console.d.ts --- a/extensions/console/lib.deno_console.d.ts +++ b/extensions/console/lib.deno_console.d.ts @@ -23,7 +23,6 @@ declare interface Console { time(label?: string): void; timeEnd(label?: string): void; timeLog(label?:...
10,455
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -3089,7 +3089,7 @@ mod tests { assert!(result.is_ok()); let response: CompletionInfo = serde_json::from_value(result.unwrap()).unwrap(); - assert_eq!(response.entries.len(), 20); + assert_eq!(response.entrie...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
Inspecting with the chrome devtools, seems to be hanging here https://github.com/denoland/deno/blob/main/op_crates/fetch/20_headers.js#L46 for a while before hanging here https://github.com/denoland/deno/blob/main/op_crates/web/00_infra.js#L120 Hits an infinite loop _right here_ :point_right: https://github.com/denolan...
2021-04-28T14:59:49Z
denoland/deno
denoland__deno-10406
[ "10396" ]
48659c374d769b877905827362387da48cf57a9c
Fetch OOMs with init param and setting headers The following script hangs for a bit and before crashing with an OOM error from v8 ```javascript const req = new Request("https://example.org"); const init = { method: "GET", }; req.headers.set("foo", "bar"); const res = await fetch(req, init); ``` ```text <-...
1.9
diff --git a/op_crates/fetch/23_request.js b/op_crates/fetch/23_request.js --- a/op_crates/fetch/23_request.js +++ b/op_crates/fetch/23_request.js @@ -247,11 +247,14 @@ // 31. if (Object.keys(init).length > 0) { - let headers = headerListFromHeaders(this[_headers]); + let headers = headerL...
10,406
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -447,6 +447,21 @@ unitTest( }, ); +unitTest( + { perms: { net: true } }, + async function fetchSeparateInit(): Promise<void> { + // related to: https://github.com/...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
2021-04-26T16:18:02Z
denoland/deno
denoland__deno-10384
[ "10380" ]
ef5e5f5e460b40b2c5f7cbcf0a1d11488fc7277f
[HTTP Native] Process ended because `nextRequest` threw error Stacktrace: ``` error: Uncaught (in promise) Http: connection closed before message completed for await (const requestEvent of httpConn) { ^ at unwrapOpResult (deno:core/core.js:100:13) at async HttpConn.n...
1.10
diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js --- a/runtime/js/40_http.js +++ b/runtime/js/40_http.js @@ -14,6 +14,8 @@ return new HttpConn(rid); } + const connErrorSymbol = Symbol("connError"); + class HttpConn { #rid = 0; diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js ---...
10,384
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts --- a/cli/tests/unit/http_test.ts +++ b/cli/tests/unit/http_test.ts @@ -272,3 +272,48 @@ unitTest( await promise; }, ); + +unitTest( + { perms: { net: true } }, + async function httpServerNextRequestErrorExposedInResponse() { + const p...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
Thanks for bringing it up. And WebSocketStream will be enabled by default on Chrome 89. [source](https://bugs.chromium.org/p/chromium/issues/detail?id=983030#c22) I have a mostly-done implementation for it on a branch, but i am not sure if it is quite correct as there is no proper spec One question: Does the WHTWHG Str...
2021-04-25T14:17:56Z
denoland/deno
denoland__deno-10365
[ "8831" ]
4d4ce4c4d815c9575a81c550f998279a0c712585
WebSocketStream API The WebSocketStream API is an API for usage of websockets using streams. There is no formal spec for it yet. https://web.dev/websocketstream/ https://docs.google.com/document/d/1XuxEshh5VYBYm1qRVKordTamCOsR-uGQBCYFcHXP4L0/edit# https://docs.google.com/document/d/1La1ehXw76HP6n1uUeks-WJGFgAnpX2tC...
1.12
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -1152,3 +1152,28 @@ declare interface WorkerOptions { }; }; } + +declare interface WebSocketStreamOptions { + protocols?: string[]; + signal?: AbortSignal;...
10,365
diff --git a/cli/tests/integration/mod.rs b/cli/tests/integration/mod.rs --- a/cli/tests/integration/mod.rs +++ b/cli/tests/integration/mod.rs @@ -643,6 +643,27 @@ fn websocket() { assert!(status.success()); } +#[test] +fn websocketstream() { + let _g = util::http_server(); + + let script = util::tests_path().j...
02c74fb70970fcadb7d1e6dab857eeb2cea20e09
2021-04-24T22:30:58Z
denoland/deno
denoland__deno-10359
[ "10211" ]
215f6f2c9e0522c7c8d794f35713225884540cd7
Support web sockets with hyper binding Probably looks like this: ```js let { respondWith, request } = await httpConn.nextRequest(); let { ws, response } = Deno.serveWebsocket(request); respondWith(response); // use web standard ws ``` Should use [tungstenite](https://crates.io/crates/tungstenite) Probably ...
1.11
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -26,11 +26,11 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "ahash" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2...
10,359
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts --- a/cli/tests/unit/http_test.ts +++ b/cli/tests/unit/http_test.ts @@ -9,6 +9,7 @@ import { assertThrowsAsync, deferred, delay, + fail, unitTest, } from "./test_util.ts"; diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/htt...
67c9937e6658c2be9b54cd95132a1055756e433b
2021-04-24T14:04:36Z
denoland/deno
denoland__deno-10350
[ "10056" ]
0d3b22a53a21544b0105f01bda297d98e1884dd4
Remove denort because link time is too slow Too much complexity in the release process.
1.9
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -224,7 +224,6 @@ jobs: run: | cd target/release zip -r deno-x86_64-unknown-linux-gnu.zip deno - zip -r denort-x86_64-unknown-linux-gnu.zip denort ...
10,350
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -376,7 +373,7 @@ jobs: - name: Clean before cache shell: bash run: | - rm -f target/*/deno target/*/denort target/*/test_server + rm -f target/*/de...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
That's a recursive call so, working as intended IMO. Why would you want to do this? or are you referring to how we handle stack overflows in general since you mentioned that Node throws and we panic? Yeah, I would expect some kind of error that can be caught in JS land. I don't think I've seen a Node.js segfault/crash...
2021-04-23T17:54:43Z
denoland/deno
denoland__deno-10338
[ "9483" ]
299518d9357ca81efa12f295f65086708f392531
stack overflow when custom inspect calls Deno.inspect on `this` If an object has a custom inspect function attached to it and it calls Deno.inspect with `this` as parameter (so that it has to invoke the same custom inspect function over and over again), Deno **crashes** with a stack overflow error. Node.js just throws...
1.9
diff --git a/op_crates/console/02_console.js b/op_crates/console/02_console.js --- a/op_crates/console/02_console.js +++ b/op_crates/console/02_console.js @@ -200,7 +200,7 @@ return inspectOptions.colors ? fn : (s) => s; } - function inspectFunction(value, ctx, level, inspectOptions) { + function inspectFun...
10,338
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -342,6 +342,14 @@ unitTest(function consoleTestStringifyCircular(): void { stringify({ str: 1, [Symbol.for("sym")]: 2, [Symbol.toStringTag]: "TAG" }), 'TAG ...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
2021-04-23T16:35:55Z
denoland/deno
denoland__deno-10335
[ "10334" ]
2400ecbe16775b54ccd9782119b09b00e3b0e786
Request.[Deno.customInspect] throws TypeError: this.url is not a function See example and link to source below. `example.ts`: ```ts const r = new Request('https://example.com'); console.log(r); ``` ``` % deno run example.ts error: Uncaught TypeError: this.url is not a function console.log(r); ^ ...
1.9
diff --git a/op_crates/fetch/23_request.js b/op_crates/fetch/23_request.js --- a/op_crates/fetch/23_request.js +++ b/op_crates/fetch/23_request.js @@ -392,7 +392,7 @@ headers: this.headers, method: this.method, redirect: this.redirect, - url: this.url(), + url: this.url, ...
10,335
diff --git a/cli/tests/unit/request_test.ts b/cli/tests/unit/request_test.ts --- a/cli/tests/unit/request_test.ts +++ b/cli/tests/unit/request_test.ts @@ -53,3 +53,17 @@ unitTest(async function cloneRequestBodyStream(): Promise<void> { assertEquals(b1, b2); }); + +unitTest(function customInspectFunction(): void {...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
Those are much more intelligible names, I agree. I would prefer `script` over `classic`. We sometimes informally refer to classic scripts as just "scripts", but the correct terminology that the web uses is "classic scripts" vs "module scripts". https://github.com/denoland/deno/blob/21ab4d94c0edca94cb71c5e444f93005074b1...
2021-04-23T15:11:26Z
denoland/deno
denoland__deno-10332
[ "10288" ]
8074d8bcf3cdcc7e9a08df147e0082798a7c2760
EmitOptions::bundle values should be "module" and "classic" - `Deno.emit({ bundle: "esm" })` -> `Deno.emit({ bundle: "module" })` - `Deno.emit({ bundle: "iife" })` -> `Deno.emit({ bundle: "classic" })` See `WorkerOptions::type`. Note that an iife is just a sensible way of emitting a classic script (whereas modules ...
1.9
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -441,10 +441,10 @@ declare namespace Deno { */ export interface EmitOptions { /** Indicate that the source code should be emitted to a single file - *...
10,332
diff --git a/cli/module_graph.rs b/cli/module_graph.rs --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -2381,7 +2384,7 @@ pub mod tests { let (emitted_files, result_info) = graph .emit(EmitOptions { check: true, - bundle_type: BundleType::Esm, + bundle_type: BundleType::Module,...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
2021-04-21T19:43:08Z
denoland/deno
denoland__deno-10295
[ "10294" ]
3b78f6c4493093701660bba496d87342ffbc08d7
Crash on fetch() Response inspect Deno `v1.9.1` crashes when inspecting fetch responses, this appears to be a regression introduced by #10203 ## Reproducible example ``` deno upgrade --version 1.9.0 &>/dev/null; deno -V; deno eval 'console.log(await fetch("https://api.ipify.org/"))' ;\ echo "\n" ;\ deno upgra...
1.9
diff --git a/op_crates/fetch/23_response.js b/op_crates/fetch/23_response.js --- a/op_crates/fetch/23_response.js +++ b/op_crates/fetch/23_response.js @@ -357,7 +357,7 @@ redirected: this.redirected, status: this.status, statusText: this.statusText, - url: this.url(), + url: thi...
10,295
diff --git a/cli/tests/unit/response_test.ts b/cli/tests/unit/response_test.ts --- a/cli/tests/unit/response_test.ts +++ b/cli/tests/unit/response_test.ts @@ -50,3 +50,20 @@ unitTest({ ignore: true }, async function responseFormData() { assert(formData instanceof FormData); assertEquals(formData, input); }); + +...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
It seems that for some reason with `X-TypeScript-Types` we aren't always resolving to the `.d.ts` file in the lsp, though we seem to be doing just fine with `deno run`.
2021-04-20T04:13:27Z
denoland/deno
denoland__deno-10261
[ "10031" ]
2079da0f1ca62795c8c95dcbc5bcb8676c367f3f
lsp: export type with X-TypeScript-Types fails ```ts export { minify } from 'https://esm.sh/terser@5.5.1' export type { ECMA } from 'https://esm.sh/terser@5.5.1' ``` <img width="1007" alt="Screen Shot 2021-02-21 at 04 06 36" src="https://user-images.githubusercontent.com/2883484/108607270-4dd8bc80-73fa-11eb-9c75-...
1.9
diff --git a/cli/lsp/sources.rs b/cli/lsp/sources.rs --- a/cli/lsp/sources.rs +++ b/cli/lsp/sources.rs @@ -315,7 +315,7 @@ impl Inner { &media_type, &self.maybe_import_map, ); - if metadata.maybe_types.is_none() { + if maybe_types.is_some() { metadata.maybe_types = maybe_types; } ...
10,261
diff --git a/cli/lsp/sources.rs b/cli/lsp/sources.rs --- a/cli/lsp/sources.rs +++ b/cli/lsp/sources.rs @@ -498,6 +513,39 @@ mod tests { assert_eq!(actual, Some((specifier_type, MediaType::Dts))) } + #[test] + /// This is a regression test for https://github.com/denoland/deno/issues/10031 + fn test_resolve_...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
Could you describe what is actually not working? All imports from, say, `./deps/discordeno.ts` will show the red squiggle of nonexistence with the message: > Module "./deps/discordeno.ts" has no exported member '&lt;import here&gt;'. (unless said file (`./deps/discordeno.ts`) is also currently open in vscode of c...
2021-04-19T08:10:30Z
denoland/deno
denoland__deno-10254
[ "10125" ]
65a2a04d3bf116c1dee8d2528ec18e71ca4d7bf2
lsp: Reexports (for dependencies) require the file containing the reexports to be open to resolve imports **Describe the bug** **To Reproduce** 1. Create file containing the following (any module can be substituted in): ```ts export * from 'https://deno.land/x/discordeno@10.5.0/mod.ts'; ``` 2. Import something ...
1.9
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -124,10 +124,7 @@ impl DocumentCache { } pub fn close(&mut self, specifier: &ModuleSpecifier) { - if let Some(mut doc) = self.docs.get_mut(specifier) { - doc.version = None; - doc.depen...
10,254
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -2357,6 +2357,7 @@ mod tests { use std::fs; use std::task::Poll; use std::time::Instant; + use tempfile::TempDir; use tower_test::mock::Spawn; enum LspResponse<V> d...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
2021-04-18T11:42:31Z
denoland/deno
denoland__deno-10239
[ "10235" ]
204b699be4cf88e216572d77ad4cced9ab4748bc
Panic when invoking `postMessage()` on a worker initialised with non-existent URL ``` ➜ deno run --allow-read worker_panic.ts Check file:///Users/sr/p/issues/worker_panic.ts error: Uncaught (in worker "") Cannot resolve module "file:///Users/sr/p/issues/doesnt_exist.js". thread 'main' panicked at 'Error 'send faile...
1.9
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -67,6 +67,14 @@ impl WebWorkerHandle { /// Post message to worker as a host. pub fn post_message(&self, buf: Box<[u8]>) -> Result<(), AnyError> { let mut sender = self.sender.clone(); + //...
10,239
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -2497,6 +2497,12 @@ console.log("finish"); exit_code: 1, }); + itest!(nonexistent_worker { + args: "run --allow-read workers/nonexistent_worker.ts", + ...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
@ry it was more than 5 lines, but [here is an example](https://gist.github.com/kitsonk/057eb9e8c456835a7a6cce14bfcb6777): ```ts const INDEX_HTML = `<!DOCTYPE html> <html> <head></head> <body> <h1>Hello world!</h1> <ul id="events"></ul> <script> const sse = new EventSource("/sse"); ...
2021-04-17T16:00:40Z
denoland/deno
denoland__deno-10225
[ "10193" ]
0a699f416b561c02e70f0fc0c44b484c504cb91a
Native HTTP: A streaming body/ServerSentEvents fails I would be able to expect to be able to utilise [SSE](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) with the native HTTP, and I can start a request, by setting the appropriate headers and return a `ReableStream` as a body, pushing "chunks" into...
1.9
diff --git a/runtime/js/40_http.js b/runtime/js/40_http.js --- a/runtime/js/40_http.js +++ b/runtime/js/40_http.js @@ -136,40 +136,51 @@ respBody = new Uint8Array(0); } - const responseBodyRid = await Deno.core.opAsync("op_http_response", [ - responseSenderRid, - innerResp.status ??...
10,225
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts --- a/cli/tests/unit/http_test.ts +++ b/cli/tests/unit/http_test.ts @@ -228,3 +228,47 @@ unitTest( await promise; }, ); + +unitTest( + { perms: { net: true } }, + async function httpServerCancelBodyOnResponseFailure() { + const promise...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
2021-04-15T22:22:05Z
denoland/deno
denoland__deno-10203
[ "10002" ]
fe59e7ae6034249c47eaf94f4258bb4467153f0d
fetch with Request init with body of FormData is broken `FormData` set as the `body: BodyInit` of the `RequestInit` passed to the `Request` constructor should behave the same way as the `body: BodyInit` of the `RequestInit` as the second arg to `fetch(input, init)` Currently it doesn't, sending a request body with t...
1.9
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -737,6 +737,7 @@ dependencies = [ "bench_util", "deno_core", "idna", + "percent-encoding", "serde", ] diff --git a/op_crates/fetch/20_headers.js b/op_crates/fetch/20_headers.js --- a/op_crates/fetch/20_headers.js +++ b/op_crates/fetch/...
10,203
diff --git a/cli/tests/077_fetch_empty.ts.out b/cli/tests/077_fetch_empty.ts.out --- a/cli/tests/077_fetch_empty.ts.out +++ b/cli/tests/077_fetch_empty.ts.out @@ -1,2 +1,2 @@ -[WILDCARD]error: Uncaught URIError: relative URL without a base +[WILDCARD]error: Uncaught TypeError: Invalid URL [WILDCARD] diff --git a/cli/t...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
Yeah, I was trying to figure out how to do that without doing the whole support for the documents. Doesn't deno fmt format all MD files? Yes, but integrating it from an language server perspective is more complicated, which is why this issue is open.
2021-04-14T09:45:19Z
denoland/deno
denoland__deno-10180
[ "9415" ]
3318c495f670b2c2ad6418276b5aff0781724e16
lsp should support formatting md files We support `deno fmt README.md` since Deno 1.7. We should also enable the LSP to format MD files.
1.10
diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -218,6 +218,17 @@ impl<'a> From<&'a diagnostics::Position> for lsp::Position { } } +/// Check if diagnostics can be generated for the provided media type. +pub fn is_diagnosable(media_type: Me...
10,180
diff --git a/cli/tests/integration_tests_lsp.rs b/cli/tests/integration_tests_lsp.rs --- a/cli/tests/integration_tests_lsp.rs +++ b/cli/tests/integration_tests_lsp.rs @@ -1659,3 +1659,126 @@ fn lsp_performance() { } shutdown(&mut client); } + +#[test] +fn lsp_format_json() { + let mut client = init("initialize_...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
@caspervonb do we have a test for this? > @caspervonb do we have a test for this? Hmm, apparently I used a buffer source in the test when I enabled that flag 🤔 @caspervonb Do we need to temporarily disable instantiateStreaming? Or implement it with Response? Because modules using Response are broken since they ...
2021-04-13T04:26:42Z
denoland/deno
denoland__deno-10158
[ "7259" ]
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
WebAssembly.instantiateStreaming does not work with Response https://github.com/hazae41/denoflate/issues/1 Since Deno 1.3.1, WebAssembly.instanciateStreaming throws the following error when module is an instance of Response (from fetch) > error: Uncaught TypeError: WebAssembly.compile(): Argument 0 must be a buff...
1.8
diff --git a/cli/dts/lib.deno.shared_globals.d.ts b/cli/dts/lib.deno.shared_globals.d.ts --- a/cli/dts/lib.deno.shared_globals.d.ts +++ b/cli/dts/lib.deno.shared_globals.d.ts @@ -192,7 +192,7 @@ declare namespace WebAssembly { maximum?: number; } - /** The value returned from `WebAssembly.instantiate` and `W...
10,158
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -3433,11 +3433,6 @@ console.log("finish"); output: "wasm_async.out", }); - itest!(wasm_streaming { - args: "run wasm_streaming.js", - output: "wasm_s...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-04-12T10:33:26Z
denoland/deno
denoland__deno-10144
[ "9912" ]
9d53dab4df64361f00dda2534eecbd04797d56a2
embedding: JsRuntime::new() fails if V8 is initialized If a deno_core embedder calls: ```rust v8::V8::initialize_platform(v8::new_default_platform().unwrap()); ``` Then subsequently calling `deno_core::JsRuntime::new(...)` results in this error: <details> ``` thread 'main' panicked at 'assertion failed: `(left...
1.8
diff --git a/core/runtime.rs b/core/runtime.rs --- a/core/runtime.rs +++ b/core/runtime.rs @@ -192,20 +199,19 @@ pub struct RuntimeOptions { /// Isolate creation parameters. pub create_params: Option<v8::CreateParams>, + + /// V8 platform instance to use. Used when Deno initializes V8 + /// (which it only doe...
10,144
diff --git a/core/runtime.rs b/core/runtime.rs --- a/core/runtime.rs +++ b/core/runtime.rs @@ -142,24 +142,31 @@ impl Drop for JsRuntime { } } -#[allow(clippy::missing_safety_doc)] -pub unsafe fn v8_init() { - let platform = v8::new_default_platform().unwrap(); - v8::V8::initialize_platform(platform); +fn v8_in...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
I set up a quick test using a detached buffer and Deno threw an exception, > ``` > error: Uncaught TypeError: Cannot perform %TypedArray%.prototype.entries on a detached ArrayBuffer > const iter = value.entries(); > ``` ```js const memory = new WebAssembly.Memory({ initial: 1, maximum: 1, shared: fals...
2021-04-11T02:40:45Z
denoland/deno
denoland__deno-10129
[ "9006" ]
e64cf4eeac7e55b40de8eadfb8493fbf3f311378
bug: encodeInto implementation is not correct You can enable the failing WPT tests by adding this snippet to `cli/tests/wpt.jsonc`: ```json { "name": "encodeInto", "expectFail": [ // TODO(lucacasonato): enable once we support MessageChannel "encodeInto() and a detached output buffer" ] }, ...
1.9
diff --git a/extensions/web/08_text_encoding.js b/extensions/web/08_text_encoding.js --- a/extensions/web/08_text_encoding.js +++ b/extensions/web/08_text_encoding.js @@ -48,51 +48,129 @@ return inRange(a, 0x00, 0x7f); } - function stringToCodePoints(input) { - const u = []; - for (const c of input) { ...
10,129
diff --git a/cli/bench/main.rs b/cli/bench/main.rs --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -89,6 +89,11 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[ &["run", "cli/tests/text_encoder_perf.js"], None, ), + ( + "text_encoder_into", + &["run", "cli/tests/text_encoder_in...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
2021-04-11T02:15:51Z
denoland/deno
denoland__deno-10127
[ "10111" ]
8aa0d5f96ed418e21efb99967f1f6b7fea0dc87f
console.table value misalignment with varying keys When the keys differ between objects, each column's values will stack upwards against the first populated cell for that column. Deno 1.8.3: ``` > console.table([ {a:0}, {a:1,b:1}, {a:2}, {a:3,b:3} ]); ┌───────┬───┬───┐ │ (idx) │ a │ b │ ├───────┼───┼───┤ │ ...
1.8
diff --git a/op_crates/console/02_console.js b/op_crates/console/02_console.js --- a/op_crates/console/02_console.js +++ b/op_crates/console/02_console.js @@ -1614,20 +1614,12 @@ return this.log(data); } - const objectValues = {}; - const indexKeys = []; - const values = []; - co...
10,127
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -1466,6 +1466,39 @@ unitTest(function consoleTable(): void { │ 2 │ │ │ 3 │ 6 │ └───────┴───┘ +`, + ); + }); + mockConsole((console, out) => { + c...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-04-10T05:36:35Z
denoland/deno
denoland__deno-10107
[ "10109" ]
875ac73f1e8459ecec3d0d7b275546740bfe007e
Add Deno.File.stat and Deno.File.statSync methods Continuing from #10106 We should add stat and statSync to the Deno.File class.
1.8
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -785,6 +785,8 @@ declare namespace Deno { readSync(p: Uint8Array): number | null; seek(offset: number, whence: SeekMode): Promise<number>; seekSync(offset: number, whence: See...
10,107
diff --git a/cli/tests/unit/file_test.ts b/cli/tests/unit/file_test.ts --- a/cli/tests/unit/file_test.ts +++ b/cli/tests/unit/file_test.ts @@ -103,3 +103,35 @@ unitTest(function fileUsingNumberFileName(): void { unitTest(function fileUsingEmptyStringFileName(): void { testSecondArgument("", ""); }); + +unitTest({ ...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-04-10T02:29:42Z
denoland/deno
denoland__deno-10103
[ "10091" ]
06b5959eed5bd634851cd52dc24dca51e48d32de
Use of eval in setTimeout/setInterval leaks internal scope ```ts setTimeout("globalThis.console.log(timer)", 1000); // { // id: 1, // callback: "globalThis.console.log(timer)", // args: [], // delay: 1000, // due: 1617982526862, // repeat: false, // scheduled: false // } ``` https://github.com...
1.8
diff --git a/runtime/js/11_timers.js b/runtime/js/11_timers.js --- a/runtime/js/11_timers.js +++ b/runtime/js/11_timers.js @@ -442,7 +442,7 @@ if ("function" === typeof callback) { callback(); } else { - eval(callback); + (0, eval)(callback); } }
10,103
diff --git a/cli/tests/unit/test_util.ts b/cli/tests/unit/test_util.ts --- a/cli/tests/unit/test_util.ts +++ b/cli/tests/unit/test_util.ts @@ -21,6 +21,7 @@ export { unreachable, } from "../../../test_util/std/testing/asserts.ts"; export { deferred } from "../../../test_util/std/async/deferred.ts"; +export type { ...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
ALPN would need to be implemented as part of HTTP/2, so effectively duplicate of #3995. @kitsonk Not per se - if the HTTP/2 server is Rust based, then an implementation of ALPN for `Deno.connectTls` or `Deno.listenTls` would need to happen separately from HTTP/2 right? I mean we wouldn't have to implemented ALPN to imp...
2021-04-08T00:11:10Z
denoland/deno
denoland__deno-10065
[ "6334" ]
a87da4b19a6da67dde15d1d0ceefaad2bdad1637
TLS ALPN support ## Feature request I thiink it is necessary to support alnp. For example, if a developer want to create a http2 server, alpn can make handshake quicker.
1.8
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -1001,6 +1001,16 @@ declare namespace Deno { options?: StartTlsOptions, ): Promise<Conn>; + export interface ListenTlsOptions { + /** **UNSTABLE**: new ...
10,065
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -5,11 +5,17 @@ use deno_core::serde_json; use deno_core::url; use deno_runtime::deno_fetch::reqwest; use deno_runtime::deno_websocket::tokio_tungstenite; +use rust...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
Working on it.
2021-04-07T15:20:31Z
denoland/deno
denoland__deno-10059
[ "10043" ]
fd65e6de3dc1ff909a1419c3b8f0c76daf1a69ed
Resource leak after calling Deno.readFileSync on directory After calling Deno.readFileSync on a directory, a file handle stays open after the "Is a directory" error is thrown. For example, take this test: ```ts import { assertThrows } from "https://deno.land/std@0.92.0/testing/asserts.ts"; Deno.test("readFile...
1.8
diff --git a/runtime/js/40_read_file.js b/runtime/js/40_read_file.js --- a/runtime/js/40_read_file.js +++ b/runtime/js/40_read_file.js @@ -7,32 +7,44 @@ function readFileSync(path) { const file = openSync(path); - const contents = readAllSync(file); - file.close(); - return contents; + try { + ...
10,059
diff --git a/cli/tests/unit/read_file_test.ts b/cli/tests/unit/read_file_test.ts --- a/cli/tests/unit/read_file_test.ts +++ b/cli/tests/unit/read_file_test.ts @@ -77,3 +77,21 @@ unitTest({ perms: { read: true } }, function readFileSyncLoop(): void { Deno.readFileSync("cli/tests/fixture.json"); } }); + +unitTes...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-04-07T14:58:43Z
denoland/deno
denoland__deno-10058
[ "10066" ]
fd65e6de3dc1ff909a1419c3b8f0c76daf1a69ed
closing laptop lid on deno run --watch causes "interrupted system call" error interesting error that occurred when I shut my laptop lid and reopened it on a watched process `deno run --unstable --watch file.ts` ``` Watcher Process finished! Restarting on file change... thread '<unnamed>' panicked at 'poll failed:...
1.8
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -12,9 +12,9 @@ dependencies = [ [[package]] name = "adler" -version = "0.2.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" ...
10,058
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -2704,29 +2681,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.123" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
`Deno.emit` intentionally does not work in compiled binaries to reduce the `--lite` mode size of standalone binaries. The error is not great, but it not working is correct.
2021-04-07T06:38:51Z
denoland/deno
denoland__deno-10052
[ "10041" ]
3b220c64f615a4e18346e8a1c07ad7b1aae9fcc6
Optionally support thick binaries for compile Given the following files ```javascript // test.ts class TestClass { stuff = ''; constructor() { this.stuff = 'foo'; } } ``` and ```javascript // emit.ts const fileName = "test.ts"; const { files, diagnostics } = await Deno.emit(fileNa...
1.10
diff --git a/cli/standalone.rs b/cli/standalone.rs --- a/cli/standalone.rs +++ b/cli/standalone.rs @@ -3,6 +3,9 @@ use crate::colors; use crate::file_fetcher::get_source_from_bytes; use crate::file_fetcher::strip_shebang; +use crate::flags::Flags; +use crate::ops; +use crate::program_state::ProgramState; use crate:...
10,052
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -5876,6 +5876,38 @@ console.log("finish"); assert_eq!(output.stdout, b"Hello Deno!\n"); } + #[test] + fn standalone_compiler_ops() { + let dir = TempDi...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
This feature also need for importing. The follow codes work in browsers but dosn't in deno yet. ```javascript import value from 'data:application/javascript,export%20default%201%3B'; import (`data:application/javascript,${encodeURIComponent('export default 1;')}`).then(x=>console.log(x.default)); ``` dynamic ...
2021-04-06T19:53:50Z
denoland/deno
denoland__deno-10045
[ "2726" ]
704e1e53307130012da974f42d2cad94e07b5664
Support for data URLs and object URLs Data URLs and Object URLs (generally of blobs) [are frequently used to dynamically create Workers](https://stackoverflow.com/a/10372280) -- support for these is missing in Deno which presents a compatibility issue with existing web code, and is an issue when trying to create worker...
1.8
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -621,6 +621,7 @@ name = "deno_file" version = "0.1.0" dependencies = [ "deno_core", + "uuid", ] [[package]] diff --git a/cli/disk_cache.rs b/cli/disk_cache.rs --- a/cli/disk_cache.rs +++ b/cli/disk_cache.rs @@ -67,7 +67,7 @@ impl DiskCach...
10,045
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -604,6 +672,7 @@ mod tests { use deno_core::error::get_custom_error_class; use deno_core::resolve_url; use deno_core::resolve_url_or_path; + use deno_runtime::deno_file::Blob; use std::rc::Rc; u...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-04-06T08:06:35Z
denoland/deno
denoland__deno-10034
[ "9774" ]
ee07ef2962e5fe52e5f40b7516cdd813109e6104
fix(cli/module_graph): Set useDefineForClassFields to true We decided to do this around https://github.com/denoland/deno/issues/7148#issuecomment-678754613, added `"useDefineForClassFields"` to the set of ignored compiler options in #7228 and documented it as set to true in #9196. Unless there was a regression, I don't...
1.8
diff --git a/cli/lsp/urls.rs b/cli/lsp/urls.rs --- a/cli/lsp/urls.rs +++ b/cli/lsp/urls.rs @@ -128,13 +128,19 @@ impl LspUrlMap { } /// Normalize URLs from the client, where "virtual" `deno:///` URLs are - /// converted into proper module specifiers. + /// converted into proper module specifiers, as well as h...
10,034
diff --git a/cli/lsp/urls.rs b/cli/lsp/urls.rs --- a/cli/lsp/urls.rs +++ b/cli/lsp/urls.rs @@ -211,4 +217,34 @@ mod tests { let actual_specifier = map.normalize_url(&actual_url); assert_eq!(actual_specifier, fixture); } + + #[cfg(windows)] + #[test] + fn test_normalize_windows_path() { + let map = Ls...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-04-06T06:41:29Z
denoland/deno
denoland__deno-10033
[ "9741" ]
2c52c0a145337050fee03313a7c5698b761969dc
Goto Type Definition broken for cdn.skypack.dev **Describe the bug** The previous (canary) extension supported dependencies from cdn.snowpack.dev, but the latest (3.1.0) extension has regressed. **To Reproduce** 1. `import postcss from "https://cdn.skypack.dev/postcss?dts";` 2. Download the dependencies via ...
1.8
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -2065,7 +2065,7 @@ impl Inner { if let Some(source) = self.sources.get_source(&specifier) { Some(source) } else { - error!("The cached s...
10,033
diff --git a/cli/lsp/urls.rs b/cli/lsp/urls.rs --- a/cli/lsp/urls.rs +++ b/cli/lsp/urls.rs @@ -158,6 +183,21 @@ mod tests { assert_eq!(actual_specifier, fixture); } + #[test] + fn test_lsp_url_map_complex_encoding() { + // Test fix for #9741 - not properly encoding certain URLs + let mut map = LspUrlM...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
Your error is basically a duplicate of #5102, check [this comment](https://github.com/denoland/deno/issues/5102#issuecomment-624716274).
2021-04-04T23:31:06Z
denoland/deno
denoland__deno-10012
[ "5477" ]
5f2a83f56346ccbbce906513f9fe56ebc42cd2e6
Deno.Listener no exposing port To extract the port from a random port in a Deno.listen is somewhat painful: ``` const listener = Deno.listen({ port: 0, transport: "tcp" }); //@ts-ignore const {port} = listener.addr this.port = port ``` While the random port doesn't seem that useful, it is extre...
1.8
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -1713,26 +1713,28 @@ declare namespace Deno { export type Addr = NetAddr | UnixAddr; /** A generic network listener for stream-oriented protocols. */ - export interface Listener ext...
10,012
diff --git a/cli/tests/unit/net_test.ts b/cli/tests/unit/net_test.ts --- a/cli/tests/unit/net_test.ts +++ b/cli/tests/unit/net_test.ts @@ -18,6 +18,12 @@ unitTest({ perms: { net: true } }, function netTcpListenClose(): void { listener.close(); }); +unitTest({ perms: { net: true } }, function netListenPortType(): ...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
There is a yet unreleased feature called `Deno.core.heapStats()` which provides this information. It should be available in 1.9 which will be released on April 13. ``` # ./target/release/deno eval --unstable -p 'Deno.core.heapStats()' { totalHeapSize: 3473408, totalHeapSizeExecutable: 262144, totalPhysical...
2021-04-03T20:47:26Z
denoland/deno
denoland__deno-9986
[ "9980" ]
fefe93c91b63e35bf88f5f432f0cca09948d0623
Deno equivalent of nodejs `process.memoryUsage()`? https://nodejs.org/api/process.html#process_process_memoryusage `process.memoryUsage()` Returns: `<Object>` ``` rss <integer> heapTotal <integer> heapUsed <integer> external <integer> arrayBuffers <integer> ``` Use case: I am converting backup software ...
1.8
diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -1166,6 +1166,15 @@ declare namespace Deno { bytesReceived: number; } + export interface MemoryUsage { + rss: number; + heapTotal: number; + heapU...
9,986
diff --git a/cli/tests/heapstats.js b/cli/tests/heapstats.js --- a/cli/tests/heapstats.js +++ b/cli/tests/heapstats.js @@ -2,15 +2,15 @@ "use strict"; function allocTest(alloc, allocAssert, deallocAssert) { - // Helper func that GCs then returns heapStats + // Helper func that GCs then returns memory usage con...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-04-03T19:09:11Z
denoland/deno
denoland__deno-9984
[ "9982" ]
824bd2f5c353f8b0893d626858bcf46e15ce4d0e
Repeat dynamic import doesn't wait for complete module evaluation `temp.ts`: ```ts import("./temp2.ts").then(() => console.log(3)); import("./temp2.ts").then(() => console.log(4)); ``` `temp2.ts`: ```ts console.log(1); await new Promise(r => setTimeout(r, 200)); console.log(2); ``` Actual output: `1 4 3 2`. ...
1.8
diff --git a/core/runtime.rs b/core/runtime.rs --- a/core/runtime.rs +++ b/core/runtime.rs @@ -784,15 +784,9 @@ impl JsRuntime { module.get_status() }; - // Since the same module might be dynamically imported more than once, - // we short-circuit is it is already evaluated. - if status == v8::Mod...
9,984
diff --git /dev/null b/cli/tests/088_dynamic_import_already_evaluating.ts new file mode 100644 --- /dev/null +++ b/cli/tests/088_dynamic_import_already_evaluating.ts @@ -0,0 +1,2 @@ +import("./088_dynamic_import_target.ts").then(() => console.log(3)); +import("./088_dynamic_import_target.ts").then(() => console.log(3))...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
Could you give a more specific example of what is/isn't working so I can reproduce it? https://user-images.githubusercontent.com/7829205/112767605-fdb3d200-9017-11eb-9e72-6f40199ee184.mp4 That question mark after `object.bar` shouldn't be added
2021-04-01T06:33:11Z
denoland/deno
denoland__deno-9951
[ "9920" ]
fec1b2a5a4324a7eecdfbb2471931f3b6b0139c5
LSP: intellisense inserts `?` after every completion All completions for optional fields of an object insert a `?` after the property name in the completion. Issue here is likely that completion label should have the `?` to mark that the completion is optional, but the actual edit text should not. Present in canary. Wa...
1.8
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -1188,10 +1188,10 @@ impl CompletionEntry { } let text_edit = - if let (Some(text_span), Some(new_text)) = (range, insert_text) { + if let (Some(text_span), Some(new_text)) = (range, &insert_text) { ...
9,951
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -3025,6 +3025,68 @@ mod tests { harness.run().await; } + #[tokio::test] + async fn test_completions_optional() { + let mut harness = LspTestHarness::new(vec![ + (...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
So one use case would be for Leaf, which is a magic file system for executables. This would allow dynamic imports for files inside this magic file system. Another use case is for tools like Aleph which import their config files which are written in JS/TS. Of course it makes sense that it is not possible to use dynamic ...
2021-03-30T17:33:02Z
denoland/deno
denoland__deno-9936
[ "9397" ]
e8be116ab6d06bed764ad9b6cb253d8de36ae73d
Base64 Loading in Binaries Hi there, While I was working on Leaf I found out that when using dynamic `import()` from base64 URLs in self contained binaries it immediately errors out. ![image](https://user-images.githubusercontent.com/66655515/106861428-98c4a700-667a-11eb-8226-0c39b68f728a.png) I think self contai...
1.10
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -191,7 +191,7 @@ pub fn map_content_type( } /// Remove shebangs from the start of source code strings -fn strip_shebang(mut value: String) -> String { +pub fn strip_shebang(mut value: String) -> String { ...
9,936
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -5844,6 +5844,38 @@ console.log("finish"); .contains("Self-contained binaries don't support module loading")); } + #[test] + fn standalone_load_datauri(...
b2a4c2e4f650f84a4f22c655a6b504b00fe0f72f
2021-03-20T13:48:22Z
denoland/deno
denoland__deno-9843
[ "9914" ]
7efea6cc20e80539c5d316d97f96c42e3343c37a
Dangling promise in async json ops when arg parsing fails This bug seems to exist since at least `v1.4.0` (when json ops were introduced to core) ## Reproducing it This bug can be reproduced with the following: ``` ❯ deno eval "var file = await Deno.open(1);" error: Module evaluation is still pending but the...
1.8
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -565,6 +565,7 @@ version = "0.82.0" dependencies = [ "anyhow", "bencher", + "erased-serde", "futures", "indexmap", "lazy_static", diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -897,6 +898,15 @@ dependencies ...
9,843
diff --git a/cli/tests/unit/dispatch_bin_test.ts b/cli/tests/unit/dispatch_bin_test.ts --- a/cli/tests/unit/dispatch_bin_test.ts +++ b/cli/tests/unit/dispatch_bin_test.ts @@ -8,9 +8,9 @@ import { const readErrorStackPattern = new RegExp( `^.* - at handleError \\(.*core\\.js:.*\\) - at binOpParseResult \\(.*...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-03-19T00:09:02Z
denoland/deno
denoland__deno-9833
[ "9925" ]
0fd1fb9329512258064c3c04e3c2d990f3748834
Run permission can be scoped/limited # Problem Hi! In the Deno project i use Python scripts. I do this with Deno.run variable: ```js Deno.run({ cmd: ['python', 'python/example.py'] }) ``` This is an incredibly useful feature, but for this I need to specify a permission flag `--allow-run`. `--...
1.8
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -1967,10 +1967,10 @@ declare namespace Deno { * * If `stdout` and/or `stderr` were set to `"piped"`, they must be closed * manually before the process can exit. - * + ...
9,833
diff --git a/cli/flags.rs b/cli/flags.rs --- a/cli/flags.rs +++ b/cli/flags.rs @@ -2032,7 +2046,7 @@ mod tests { }, allow_net: Some(vec![]), allow_env: true, - allow_run: true, + allow_run: Some(vec![]), allow_read: Some(vec![]), allow_write: Some(vec![]), ...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
This is fixed by https://github.com/AaronO/deno/commit/b7e3911cb8d77ef97124ea8e32986054f7e0034d in #9800 ```js ❯ cat << EOF | ./target/debug/deno run -A --unstable - const client = Deno.createHttpClient({}); const response = await fetch( "https://dump-headers.herokuapp.com/", { client }, ); const dat...
2021-03-18T20:43:03Z
denoland/deno
denoland__deno-9830
[ "9827" ]
fb5a2786ec9854ceca840daeb9ae154dcf804d12
Deno.createHttpClient() leaves User-Agent undefined Discovered whilst working on #9800 ## Reproducible example ```js ❯ cat << EOF | deno run -A --unstable - const client = Deno.createHttpClient({}); const response = await fetch( "https://dump-headers.herokuapp.com/", { client }, ); const data = aw...
1.8
diff --git a/op_crates/fetch/lib.rs b/op_crates/fetch/lib.rs --- a/op_crates/fetch/lib.rs +++ b/op_crates/fetch/lib.rs @@ -23,8 +23,10 @@ use deno_core::RcRef; use deno_core::Resource; use deno_core::ZeroCopyBuf; +use reqwest::header::HeaderMap; use reqwest::header::HeaderName; use reqwest::header::HeaderValue; +...
9,830
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -1063,6 +1063,27 @@ MNf4EgWfK+tZMnuqfpfO9740KzfcVoMNo4QJD4yn5YxroUOO/Azi }, ); +unitTest( + { perms: { net: true } }, + async function fetchCustomClientUserAgent(): P...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
FYI Deno.env now takes string as argument. See #2951 #2952 @kt3k I never know! But setting environment variables should also be managed, shouldn't it? Agree on this one. It feels odd requiring `--allow-env` just to do: ```ts const cfg = path.join(Deno.dir('home'), '.myapprc') await fs.readFileStr(cfg) ``` For ...
2021-03-18T14:58:07Z
denoland/deno
denoland__deno-9825
[ "3137" ]
9d53dab4df64361f00dda2534eecbd04797d56a2
Limited Permission for --allow-env Currently `--allow-env` gives program unlimited permission to access any environment variable. It's much strong privilege and there should be more limited permission control for them. Like `--allow-net=:9999`, how about these? `--allow-env=DEBUG`, `--allow-env=DENO_DIR,DENO_INSTALL...
1.8
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -2164,6 +2164,7 @@ declare namespace Deno { export interface EnvPermissionDescriptor { name: "env"; + variable?: string; } export interface PluginPermissionDescriptor { ...
9,825
diff --git a/cli/flags.rs b/cli/flags.rs --- a/cli/flags.rs +++ b/cli/flags.rs @@ -2054,7 +2084,7 @@ mod tests { script: "gist.ts".to_string(), }, allow_net: Some(vec![]), - allow_env: true, + allow_env: Some(vec![]), allow_run: Some(vec![]), allow_read: Some...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-03-15T22:50:52Z
denoland/deno
denoland__deno-9800
[ "9827" ]
cdd2355f0f516e55ef638f38006677003685a92f
Deno.createHttpClient() leaves User-Agent undefined Discovered whilst working on #9800 ## Reproducible example ```js ❯ cat << EOF | deno run -A --unstable - const client = Deno.createHttpClient({}); const response = await fetch( "https://dump-headers.herokuapp.com/", { client }, ); const data = aw...
1.9
diff --git /dev/null b/core/extensions.rs new file mode 100644 --- /dev/null +++ b/core/extensions.rs @@ -0,0 +1,105 @@ +use crate::error::AnyError; +use crate::{OpFn, OpState}; + +pub type SourcePair = (&'static str, &'static str); +pub type OpPair = (&'static str, Box<OpFn>); +pub type OpMiddlewareFn = dyn Fn(&'stati...
9,800
diff --git a/cli/tests/unit/metrics_test.ts b/cli/tests/unit/metrics_test.ts --- a/cli/tests/unit/metrics_test.ts +++ b/cli/tests/unit/metrics_test.ts @@ -69,3 +69,12 @@ unitTest( assert(metrics.opsDispatchedAsync === metrics.opsCompletedAsync); }, ); + +// Test that ops from op_crates have metrics (via OpMidd...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
This was fixed in https://github.com/swc-project/swc/issues/930. We need to add a `typescript_class_properties` pass for it, but there were bugs/complications: https://github.com/swc-project/swc/issues/987. Actually, we ultimately decided to have `"useDefineForClassFields": true` in our internal tsconfig (https://githu...
2021-03-12T23:56:46Z
denoland/deno
denoland__deno-9774
[ "9773" ]
a22aadbe50879408fc299c3a1233a65bec018b34
Deno bundle error with constructor property initialisation Following example works with `deno run` but fails after bundling it with `deno bundle`. **Example code:** ```typescript export class Foo { bar = this.options.bar; constructor( protected options: { bar: string }, ) {} } console.log( new...
1.8
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -314,6 +314,7 @@ impl Inner { "noEmit": true, "strict": true, "target": "esnext", + "useDefineForClassFields": true, })); let (maybe_config, maybe...
9,774
diff --git /dev/null b/cli/tests/088_use_define_for_class_fields.ts new file mode 100644 --- /dev/null +++ b/cli/tests/088_use_define_for_class_fields.ts @@ -0,0 +1,4 @@ +class A { + b = this.a; + constructor(public a: unknown) {} +} diff --git /dev/null b/cli/tests/088_use_define_for_class_fields.ts.out new file mod...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
2021-03-12T15:55:35Z
denoland/deno
denoland__deno-9770
[ "7540" ]
e83ff62ccbe33ad9c19cb9cab9154b6767d6d74b
Reenable tests disabled during fetch crate refactor - [x] `file_server running as library std/http/file_server_test.ts - [ ] `nativeEndLine` cli/tests/unit/blob_test.ts - [ ] `testDomIterable` cli/tests/unit/dom_iterable_test.ts
1.8
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -552,6 +552,13 @@ dependencies = [ "winres", ] +[[package]] +name = "deno_console" +version = "0.1.0" +dependencies = [ + "deno_core", +] + [[package]] name = "deno_core" version = "0.80.2" diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo...
9,770
diff --git a/cli/tests/unit/dom_iterable_test.ts b/cli/tests/unit/dom_iterable_test.ts --- a/cli/tests/unit/dom_iterable_test.ts +++ b/cli/tests/unit/dom_iterable_test.ts @@ -1,7 +1,6 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -/* TODO https://github.com/denoland/deno/issues/7540 -...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
This is blocked on wgpu 0.8 release. Once that is out we will disable the new `cross` feature on `wgpu`. For reference, wgpu 0.8 has no ETA yet. For now just install libc++. #9760 will fix this.
2021-03-11T21:11:07Z
denoland/deno
denoland__deno-9760
[ "9686" ]
bb12c7a57aac2bd45806ba2f5229d1133ff71851
Building Alpine linux now requires libc++ (and then prints warnings) Running deno executable on alpine (frolvlad/alpine-glibc since glibc is required) fails since 1.8.0: ``` # running deno deno: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory ``` if...
1.9
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -83,12 +83,15 @@ name = "arrayvec" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +dependencies = [ + "serde", +] [[package]] ...
9,760
diff --git a/cli/tests/unit/webgpu_test.ts b/cli/tests/unit/webgpu_test.ts --- a/cli/tests/unit/webgpu_test.ts +++ b/cli/tests/unit/webgpu_test.ts @@ -49,18 +49,13 @@ unitTest({ storageBuffer.unmap(); - const bindGroupLayout = device.createBindGroupLayout({ - entries: [ - { - binding: 0, - ...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
Can you provide the version of Deno you were using? Also, what you were doing at the time it occurred? Either deno 1.7.0 or deno 1.7.1 (not sure, sorry) and I was editing the .vscode/settings.json Are you using a `tsconfig.json` with the workspace? If so, could you share it? I do not. Didn't even know I could to be h...
2021-03-10T05:56:24Z
denoland/deno
denoland__deno-9746
[ "9348" ]
db96be7cdc3b9d8c8d5373e90ca6c2c57599529b
lsp errors with "The current snapshot version is missing." I have no idea what exactly happened ``` thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', cli\lsp\tsc.rs:806:43 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace Error processing TypeScript diagnostic...
1.8
diff --git a/cli/lsp/sources.rs b/cli/lsp/sources.rs --- a/cli/lsp/sources.rs +++ b/cli/lsp/sources.rs @@ -163,14 +163,6 @@ impl Sources { self.0.lock().unwrap().contains_key(specifier) } - /// Provides the length of the source content, calculated in a way that should - /// match the behavior of JavaScript,...
9,746
diff --git a/cli/lsp/sources.rs b/cli/lsp/sources.rs --- a/cli/lsp/sources.rs +++ b/cli/lsp/sources.rs @@ -471,19 +456,6 @@ mod tests { assert_eq!(actual, "console.log(\"Hello World\");\n"); } - #[test] - fn test_sources_get_length_utf16() { - let (sources, _) = setup(); - let c = PathBuf::from(env::v...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-03-07T02:12:22Z
denoland/deno
denoland__deno-9714
[ "9709" ]
2894c0e615bf99e86f80ab1d2c7278be9769a52b
deno bundle should respect compiler option `importsNotUsedAsValues: "preserve"` The emitted esm bundle by `deno bundle` does not preserve imports whose values or types are never used. For example, this could be useful for compiling browser native [Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Comp...
1.8
diff --git a/cli/ast.rs b/cli/ast.rs --- a/cli/ast.rs +++ b/cli/ast.rs @@ -182,6 +182,13 @@ pub fn get_syntax(media_type: &MediaType) -> Syntax { } } +#[derive(Debug, Clone)] +pub enum ImportsNotUsedAsValues { + Remove, + Preserve, + Error, +} + /// Options which can be adjusted when transpiling a module. #[...
9,714
diff --git /dev/null b/cli/tests/087_hello.ts new file mode 100644 --- /dev/null +++ b/cli/tests/087_hello.ts @@ -0,0 +1,2 @@ +export type SomeType = unknown; +console.log("Hello, world!"); diff --git /dev/null b/cli/tests/087_no_check_imports_not_used_as_values.ts new file mode 100644 --- /dev/null +++ b/cli/tests/087...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-03-03T14:09:44Z
denoland/deno
denoland__deno-9668
[ "9667" ]
da5ca4f521828a8b31cf22ee227000c2910df28b
deno compile add the .exe extension on windows even if the target is specified I am trying to compile an example for different targets, but deno compile it adds the `.exe` even though the target is specified. ![image](https://user-images.githubusercontent.com/47539192/109817320-3377bd80-7c08-11eb-923e-0b1b888becab.p...
1.8
diff --git a/cli/main.rs b/cli/main.rs --- a/cli/main.rs +++ b/cli/main.rs @@ -344,7 +344,7 @@ async fn compile_command( // Select base binary based on `target` and `lite` arguments let original_binary = - tools::standalone::get_base_binary(deno_dir, target, lite).await?; + tools::standalone::get_base_bin...
9,668
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -7,6 +7,7 @@ use deno_runtime::deno_fetch::reqwest; use deno_runtime::deno_websocket::tokio_tungstenite; use std::fs; use std::io::{BufRead, Read, Write}; +use std...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
I'm in favor of this change, I think we should land it for `1.6.0` similar to previous `deno info` overhaul in `1.4.0`. JSON output of `deno info` requires `--unstable` flag so this part is not a big deal to change. I've assigned it to myself and will do it when we get closer to 1.6.0... We should wait for the JSON ...
2021-03-01T06:02:46Z
denoland/deno
denoland__deno-9630
[ "7927" ]
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
Represent type-only dependencies in deno info Currently we do not represent type only dependencies (`@deno-types`, `X-TypeScript-Types` and triple slash types directives in JS files) in the output of `deno info`, even though they are part of what gets loaded and cached and are part of the module graph. We should refle...
1.7
diff --git a/cli/colors.rs b/cli/colors.rs --- a/cli/colors.rs +++ b/cli/colors.rs @@ -39,95 +39,107 @@ pub fn enable_ansi() { BufferWriter::stdout(ColorChoice::AlwaysAnsi); } -fn style(s: &str, colorspec: ColorSpec) -> impl fmt::Display { +fn style<S: AsRef<str>>(s: S, colorspec: ColorSpec) -> impl fmt::Display ...
9,630
diff --git a/cli/info.rs b/cli/info.rs --- a/cli/info.rs +++ b/cli/info.rs @@ -202,7 +275,7 @@ pub fn human_size(size: f64) -> String { #[cfg(test)] mod test { use super::*; - use deno_core::resolve_url_or_path; + use deno_core::resolve_url; use deno_core::serde_json::json; #[test] diff --git a/cli/info....
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
2021-02-27T19:24:39Z
denoland/deno
denoland__deno-9619
[ "9643", "8863" ]
79e2e6a1f47b9d24abab14cfd69376d825b52e03
Inspector blocked during top-level await ```ts // deno run --inspect temp.ts setTimeout(null, 1e8); // Keeps the process alive. await new Promise(r => {}); ``` When I run this and go to `chrome://inspect/`, the remote target is there but when I click "trace", there is **no** `Debugger session started.` in the ter...
1.8
diff --git a/core/runtime.rs b/core/runtime.rs --- a/core/runtime.rs +++ b/core/runtime.rs @@ -853,14 +853,19 @@ impl JsRuntime { Ok(()) } + // TODO(bartlomieju): make it return `ModuleEvaluationFuture`? /// Evaluates an already instantiated ES module. /// + /// Returns a receiver handle that resolves...
9,619
diff --git a/cli/tests/workers/test.ts b/cli/tests/workers/test.ts --- a/cli/tests/workers/test.ts +++ b/cli/tests/workers/test.ts @@ -675,3 +675,24 @@ Deno.test({ w.terminate(); }, }); + +Deno.test({ + name: "Worker with top-level-await", + fn: async function (): Promise<void> { + const result = deferred...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
I understand that this is intentional, per the docs for [`std::env::set_var`](https://doc.rust-lang.org/std/env/fn.set_var.html#panics): >This function may panic if `key` is empty, contains an ASCII equals sign `'='` or the NUL character `'\0'`, or when the value contains the NUL character. ...however, while an a...
2021-02-22T17:07:02Z
denoland/deno
denoland__deno-9583
[ "9558" ]
8be0c8b43a56ee690463efb3e68686f0fefa868b
Deno.env.set("", "") causes the runtime to panic `Deno.env.set("", "")` causes the runtime to panic. ```console $ deno --version deno 1.7.2 (release, x86_64-apple-darwin) v8 8.9.255.3 typescript 4.1.3 $ RUST_BACKTRACE=full deno eval 'Deno.env.set("", "")' thread 'main' panicked at 'failed to set environment vari...
1.7
diff --git a/runtime/ops/os.rs b/runtime/ops/os.rs --- a/runtime/ops/os.rs +++ b/runtime/ops/os.rs @@ -1,7 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. use crate::permissions::Permissions; -use deno_core::error::AnyError; +use deno_core::error::{type_error, AnyError}; use deno...
9,583
diff --git a/cli/tests/unit/os_test.ts b/cli/tests/unit/os_test.ts --- a/cli/tests/unit/os_test.ts +++ b/cli/tests/unit/os_test.ts @@ -27,6 +27,21 @@ unitTest({ perms: { env: true } }, function deleteEnv(): void { assertEquals(Deno.env.get("TEST_VAR"), undefined); }); +unitTest({ perms: { env: true } }, function ...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
Looking into it.
2021-02-22T14:33:07Z
denoland/deno
denoland__deno-9579
[ "9578" ]
8be0c8b43a56ee690463efb3e68686f0fefa868b
Deno.readDir("/dev/fd") is panic ``` ❯ deno --version deno 1.7.5 (release, x86_64-apple-darwin) v8 9.0.123 typescript 4.1.4 ❯ deno eval 'Deno.readDir("/dev/fd")' thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 9, kind: Other, message: "Bad file descriptor" }', ...
1.7
diff --git a/runtime/ops/fs.rs b/runtime/ops/fs.rs --- a/runtime/ops/fs.rs +++ b/runtime/ops/fs.rs @@ -1022,20 +1022,19 @@ fn op_read_dir_sync( let entries: Vec<_> = std::fs::read_dir(path)? .filter_map(|entry| { let entry = entry.unwrap(); - let file_type = entry.file_type().unwrap(); // Not...
9,579
diff --git a/cli/tests/unit/read_dir_test.ts b/cli/tests/unit/read_dir_test.ts --- a/cli/tests/unit/read_dir_test.ts +++ b/cli/tests/unit/read_dir_test.ts @@ -78,3 +78,23 @@ unitTest({ perms: { read: false } }, async function readDirPerm(): Promise< await Deno.readDir("tests/")[Symbol.asyncIterator]().next(); }...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
Seems to be fixed on SWC's side; closing here. I would like to keep it open until we merge the version of dprint that this is fixed in. Ah, okay, fine with me. I'm not sure if it's related, but I've got another snippet where I got a comment deleted: ```js const _ = [ 1, /* 2 */, 3, 4, ]; ``` Can some...
2021-02-21T16:51:27Z
denoland/deno
denoland__deno-9566
[ "9477" ]
af93256d05993b53debe0552828b6ae7df521750
deno fmt deletes code sometimes with invalid syntax I was writing some code, here's an example: ```js const Methods { f: (x, y) => x + y, }; export default Methods; ``` Look closely, notice how I forgot my assignment operator after "Methods." `deno fmt` decides to, instead of throwing an error, eat th...
1.7
diff --git a/.dprintrc.json b/.dprintrc.json --- a/.dprintrc.json +++ b/.dprintrc.json @@ -34,8 +34,8 @@ "tools/wpt/manifest.json" ], "plugins": [ - "https://plugins.dprint.dev/typescript-0.33.0.wasm", - "https://plugins.dprint.dev/json-0.7.2.wasm", - "https://plugins.dprint.dev/markdown-0.4.2.wasm"...
9,566
diff --git a/cli/tests/fmt/expected_fmt_check_tests_dir.out b/cli/tests/fmt/expected_fmt_check_tests_dir.out --- a/cli/tests/fmt/expected_fmt_check_tests_dir.out +++ b/cli/tests/fmt/expected_fmt_check_tests_dir.out @@ -1,2 +1,2 @@ [WILDCARD] -error: Found 7 not formatted files in [WILDCARD] files +error: Found 6 not f...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
Is there a reproduction that doesn't use dynamic imports? Hmmmm... ```js Promise.reject(new Error("ooops")); ``` ``` error: Uncaught (in promise) Error: ooops Promise.reject(new Error("ooops")); ^ at file:///Users/kitsonk/github/deno/test.js:1:16 ``` So only loader/core promises? @ba...
2021-02-21T05:40:53Z
denoland/deno
denoland__deno-9562
[ "8769" ]
10fb25db632f5f4febc7802c4909813b138b6c64
Uncaught dynamic import promise error should log the stack... We should log the stack trace in uncaught promise errors. Currently we get something like: ``` error: Uncaught (in promise) TypeError: Cannot resolve module "file:///a/bad.js". ``` When if the error is caught on the rejected promise and the stack lo...
1.7
diff --git a/core/bindings.rs b/core/bindings.rs --- a/core/bindings.rs +++ b/core/bindings.rs @@ -11,6 +11,7 @@ use futures::future::FutureExt; use rusty_v8 as v8; use std::cell::Cell; use std::convert::TryFrom; +use std::convert::TryInto; use std::io::{stdout, Write}; use std::option::Option; use url::Url; diff...
9,562
diff --git a/cli/tests/error_005_missing_dynamic_import.ts.out b/cli/tests/error_005_missing_dynamic_import.ts.out --- a/cli/tests/error_005_missing_dynamic_import.ts.out +++ b/cli/tests/error_005_missing_dynamic_import.ts.out @@ -1,1 +1,4 @@ error: Uncaught (in promise) TypeError: Cannot resolve module "[WILDCARD]/cl...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
it works in node v14, so I think there is something wrong, I will try to find it out the test command is `node --harmony-top-level-await a.mjs`, before test you need rename `.ts` to `.mjs` Just tried on latest `master` ``` ▶ target/debug/deno run --allow-read a.ts caught import b.ts error TypeError: Cannot res...
2021-02-20T18:15:29Z
denoland/deno
denoland__deno-9559
[ "6259" ]
4f80587d26891f783b1a7a46b0f3273def49cd6e
Errors in dynamic imports are not properly caught Runtime ``` debian 10 deno 1.6.2 v8 8.8.278.2 typescript 4.1.3 ``` ------ ```ts //a.ts import("./b.ts").catch(e=>{ console.log("caught import b.ts error") console.error(e) }) import("./c.ts").catch(e=>{ console.log("caught import c.ts error") ...
1.7
diff --git a/core/runtime.rs b/core/runtime.rs --- a/core/runtime.rs +++ b/core/runtime.rs @@ -734,33 +734,51 @@ impl JsRuntime { /// `AnyError` can be downcast to a type that exposes additional information /// about the V8 exception. By default this type is `JsError`, however it may /// be a different type if...
9,559
diff --git /dev/null b/cli/tests/086_dynamic_import_already_rejected.ts new file mode 100644 --- /dev/null +++ b/cli/tests/086_dynamic_import_already_rejected.ts @@ -0,0 +1,11 @@ +try { + await import("./error_001.ts"); +} catch (error) { + console.log(`Caught: ${error.stack}`); +} + +try { + await import("./error_0...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
2021-02-17T13:21:31Z
denoland/deno
denoland__deno-9527
[ "9518" ]
bb30e9291e2e3964aac2d2ca05b739dcc67d64a0
deno lint doesn't work with URLs ``` > deno lint --unstable https://deno.land/x/oak@v6.4.2/router.ts Checked 0 file ``` At minimum it should error out...
1.7
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -37,7 +37,13 @@ pub async fn format( ) -> Result<(), AnyError> { let target_file_resolver = || { // collect the files that are to be formatted - collect_files(&args, &ignore, is_supported_ext_fmt) + collect_...
9,527
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -537,7 +537,9 @@ mod integration { .expect("Failed to spawn script") .wait() .expect("Failed to wait for child process"); - assert!(status.suc...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
Thanks @kitsonk for opening this issue! There are some major discussions around dependency management, and the general consensus is that this should be done in userland rather than built into deno. In general, my point is that flagging this as unstable will be a major blocker for future userland innovations in de...
2021-02-17T12:37:05Z
denoland/deno
denoland__deno-9526
[ "4958" ]
c2a7386a429f11f08f003467e7351f9b262649c4
discussion: Make import maps stable Based on a discussion in Discord, @shian15810 suggests that marking import maps unstable is going to be problematic (as well as brings it up in #4933 but it should have its own issue). I am torn, the spec only has one implementor (Chromium 74+) and Firefox and Safari as well as ot...
1.7
diff --git a/cli/flags.rs b/cli/flags.rs --- a/cli/flags.rs +++ b/cli/flags.rs @@ -1690,11 +1690,9 @@ fn import_map_arg<'a, 'b>() -> Arg<'a, 'b> { .long("import-map") .alias("importmap") .value_name("FILE") - .requires("unstable") - .help("UNSTABLE: Load import map file") + .help("Load import ma...
9,526
diff --git a/cli/flags.rs b/cli/flags.rs --- a/cli/flags.rs +++ b/cli/flags.rs @@ -2464,7 +2462,7 @@ mod tests { #[test] fn eval_with_flags() { #[rustfmt::skip] - let r = flags_from_vec(svec!["deno", "eval", "--unstable", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
Hello! >This means that it is impossible to do goto definition and other "challenges" with using data URLs in the editor. Yes, this is very annoying. I use `vim-lsp` with `deno lsp`. Currently GoTo definition did not work well even if `deno cache` ran. It would be very grad to GoTo proper cached file. @heave...
2021-02-17T01:15:19Z
denoland/deno
denoland__deno-9522
[ "9514" ]
78e34d49120d8cc2583d8d6d28ae9b74f9765533
data URLs not well handled in lsp Data URLs are only partially handled in the LSP at the moment. They first appear as "not found" until they are cached. This feels like the right behaviour, though the code action and the diagnostic message could be more informative. The problem is that the source is unavailable, a...
1.7
diff --git a/cli/lsp/README.md b/cli/lsp/README.md --- a/cli/lsp/README.md +++ b/cli/lsp/README.md @@ -22,13 +22,38 @@ implement these in order to have a fully functioning client that integrates well with Deno: - `deno/cache` - This command will instruct Deno to attempt to cache a module - and all of its dependenc...
9,522
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -2170,15 +2182,15 @@ mod tests { ("initialize_request.json", LspResponse::RequestAny), ("initialized_notification.json", LspResponse::None), ("did_open_notificat...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
This is a show stopper for Deno at many companies who need to use private modules and have a policy of not embedding auth tokens into their software. What we need is a decent proposal of what the UI should be for passing it. It should be easy to specify multiple tokens for different hosts, and only when connecting to ...
2021-02-14T23:11:57Z
denoland/deno
denoland__deno-9508
[ "5239" ]
a6beab824815cededf0ba9fc7904d3b00fde75e4
Support access token authorisation for remote files Currently there is no way to fetch remote modules from private GitHub repositories without exposing your access token. For example you could do the following currently: ```ts import * as foo from "https://$TOKEN@raw.githubusercontent.com/private_org/private_rep...
1.7
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -1,9 +1,11 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +use crate::auth_tokens::AuthTokens; use crate::colors; use crate::http_cache::HttpCache; use crate::http_util::cre...
9,508
diff --git /dev/null b/cli/auth_tokens.rs new file mode 100644 --- /dev/null +++ b/cli/auth_tokens.rs @@ -0,0 +1,144 @@ +// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. + +use deno_core::ModuleSpecifier; +use std::fmt; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct AuthToken { + host:...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
it works in node v14, so I think there is something wrong, I will try to find it out the test command is `node --harmony-top-level-await a.mjs`, before test you need rename `.ts` to `.mjs` Just tried on latest `master` ``` ▶ target/debug/deno run --allow-read a.ts caught import b.ts error TypeError: Cannot res...
2021-02-14T20:04:17Z
denoland/deno
denoland__deno-9505
[ "6259" ]
d9b1f96897239bf7de8cdfd11d40e3f99bb29a4a
Errors in dynamic imports are not properly caught Runtime ``` debian 10 deno 1.6.2 v8 8.8.278.2 typescript 4.1.3 ``` ------ ```ts //a.ts import("./b.ts").catch(e=>{ console.log("caught import b.ts error") console.error(e) }) import("./c.ts").catch(e=>{ console.log("caught import c.ts error") ...
1.7
diff --git a/core/runtime.rs b/core/runtime.rs --- a/core/runtime.rs +++ b/core/runtime.rs @@ -822,6 +822,12 @@ impl JsRuntime { ); let promise = v8::Local::<v8::Promise>::try_from(value) .expect("Expected to get promise as module evaluation result"); + let empty_fn = |_scope: &mut v...
9,505
diff --git /dev/null b/cli/tests/085_dynamic_import_async_error.ts new file mode 100644 --- /dev/null +++ b/cli/tests/085_dynamic_import_async_error.ts @@ -0,0 +1,5 @@ +try { + await import("./delayed_error.ts"); +} catch (error) { + console.log(`Caught: ${error.stack}`); +} diff --git /dev/null b/cli/tests/085_dynam...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
Was this off a `--no-check`?
2021-02-09T23:54:41Z
denoland/deno
denoland__deno-9462
[ "9443" ]
af460fc464562566dc1534c0f61f53c2976b9bd7
Stack traces include angle characters around URL Here's a stack trace I was seeing recently ``` error: Uncaught SyntaxError: Missing initializer in const declaration declare global { ~~~~~~~ at <anonymous> (<https://deno.land/std@0.66.0/node/process.ts>:99:1) ``` Why are there "<" and ">" characters around t...
1.7
diff --git a/cli/source_maps.rs b/cli/source_maps.rs --- a/cli/source_maps.rs +++ b/cli/source_maps.rs @@ -3,6 +3,7 @@ //! This mod provides functions to remap a `JsError` based on a source map. use deno_core::error::JsError; +use deno_core::ModuleSpecifier; use sourcemap::SourceMap; use std::collections::HashMap...
9,462
diff --git /dev/null b/cli/tests/error_026_remote_import_error.ts new file mode 100644 --- /dev/null +++ b/cli/tests/error_026_remote_import_error.ts @@ -0,0 +1,1 @@ +import "http://localhost:4545/cli/tests/error_001.ts"; diff --git /dev/null b/cli/tests/error_026_remote_import_error.ts.out new file mode 100644 --- /de...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. This issue has been [automatically marked as stale](https://probot.github.io/apps/stale/#how-it-works) because it has not had recent activity. It ...
2021-02-09T19:05:41Z
denoland/deno
denoland__deno-9457
[ "8173" ]
0d26a82ea9169c013e9b0f29c1ec418b28e273cf
dispatch_minimal should use promise table from Deno.core Currently we have two different dispatch mechanism implemented: - minimal - used for io ops (`op_read` and `op_write`) - JSON - used for all other ops Each of these mechanism has separate promise table that is used to store promises awaiting response from Ru...
1.8
diff --git a/core/core.js b/core/core.js --- a/core/core.js +++ b/core/core.js @@ -30,13 +30,22 @@ SharedQueue Binary Layout const core = window.Deno.core; const { recv, send } = core; + //////////////////////////////////////////////////////////////////////////////////////////// + ////////////////////////////...
9,457
diff --git a/cli/tests/unit/dispatch_buffer_test.ts b/cli/tests/unit/dispatch_bin_test.ts --- a/cli/tests/unit/dispatch_buffer_test.ts +++ b/cli/tests/unit/dispatch_bin_test.ts @@ -8,9 +8,9 @@ import { const readErrorStackPattern = new RegExp( `^.* - at handleError \\(.*10_dispatch_buffer\\.js:.*\\) - at bu...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-02-09T03:32:09Z
denoland/deno
denoland__deno-9453
[ "9452" ]
36e9e53b37c4983da4ba7a8c30e13cfe27f42855
Deno.connectTls panics when given invalid hostname Culprit is a call to `.expect()` in both `connectTls` and `startTls`. Should be a regular exception instead of a panic. Trivial repro: ``` console > await Deno.connectTls({hostname: '8.8.8.8', port: 443}) thread 'main' panicked at 'Invalid DNS lookup: InvalidDN...
1.7
diff --git a/runtime/ops/tls.rs b/runtime/ops/tls.rs --- a/runtime/ops/tls.rs +++ b/runtime/ops/tls.rs @@ -140,8 +140,8 @@ async fn op_start_tls( } let tls_connector = TlsConnector::from(Arc::new(config)); - let dnsname = - DNSNameRef::try_from_ascii_str(&domain).expect("Invalid DNS lookup"); + let dnsname...
9,453
diff --git a/cli/tests/unit/tls_test.ts b/cli/tests/unit/tls_test.ts --- a/cli/tests/unit/tls_test.ts +++ b/cli/tests/unit/tls_test.ts @@ -20,6 +20,24 @@ unitTest(async function connectTLSNoPerm(): Promise<void> { }, Deno.errors.PermissionDenied); }); +unitTest( + { perms: { read: true, net: true } }, + async f...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
2021-02-08T02:50:09Z
denoland/deno
denoland__deno-9437
[ "9420" ]
0cac243a835d86ad5f37d50bdd1634bd4fe2d2d6
data url is not working with `--import-map` option ```ts // main.ts const a = await import("data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo=") console.log(a.a) ``` with an empty `import-map.json` ```json {} ``` my **command** is `deno run -...
1.7
diff --git a/cli/import_map.rs b/cli/import_map.rs --- a/cli/import_map.rs +++ b/cli/import_map.rs @@ -34,9 +34,9 @@ impl fmt::Display for ImportMapError { impl Error for ImportMapError {} -// NOTE: here is difference between deno and reference implementation - deno currently -// can't resolve URL with other sche...
9,437
diff --git a/cli/import_map.rs b/cli/import_map.rs --- a/cli/import_map.rs +++ b/cli/import_map.rs @@ -863,9 +863,9 @@ mod tests { "http://good/": {}, "https://good/": {}, "file:///good": {}, + "data:good": {}, "about:bad": {}, "blob:bad": {}, - "data:bad": {},...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
Yes, I am currently working for a fix on this.
2021-02-08T01:45:46Z
denoland/deno
denoland__deno-9436
[ "9425" ]
900953a65a7cb54eb8d11eba4a30e52da7dbb469
lsp: JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists Deno: 1.7.2 Extension: Canary v0.0.8 PS: No issue when use v2.3.3 ![Screenshot from 2021-02-06 20-39-31](https://user-images.githubusercontent.com/10122431/107119619-72417e80-68bb-11eb-827a-7f1aa91368d6.png)
1.7
diff --git a/cli/lsp/analysis.rs b/cli/lsp/analysis.rs --- a/cli/lsp/analysis.rs +++ b/cli/lsp/analysis.rs @@ -16,6 +16,7 @@ use deno_core::error::AnyError; use deno_core::serde::Deserialize; use deno_core::serde::Serialize; use deno_core::serde_json::json; +use deno_core::ModuleResolutionError; use deno_core::Modu...
9,436
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs --- a/cli/lsp/documents.rs +++ b/cli/lsp/documents.rs @@ -234,11 +212,7 @@ mod tests { let specifier = ModuleSpecifier::resolve_url("file:///a/b.ts").unwrap(); let missing_specifier = ModuleSpecifier::resolve_url("file:///a/c.ts").unwrap(); - ...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
It should just work, it is a bug with the lsp that we need to fix. Is there a work around I can use in the mean time? I tried adding a tsconfig.json which from what I've read should fix it. But it seems like deno_vscode doesn't pick up on it. ```json { "compilerOptions": { "jsx": "react-jsx", } ...
2021-02-05T05:30:54Z
denoland/deno
denoland__deno-9407
[ "8993" ]
923214c53725651792f6d55c5401bf6b475622ea
lsp: JSX cannot be used How can I pass the `--jsx` flag to the deno lsp? **Describe the bug** While using the Canary extension, I get the following errors all over my project. ```ts JSX element implicitly has type 'any' because no interface 'JSX.IntrinsicElements' exists. deno-ts(7026) Cannot use JSX unless ...
1.7
diff --git a/cli/lsp/language_server.rs b/cli/lsp/language_server.rs --- a/cli/lsp/language_server.rs +++ b/cli/lsp/language_server.rs @@ -431,8 +431,10 @@ impl Inner { let mark = self.performance.mark("update_tsconfig"); let mut tsconfig = TsConfig::new(json!({ "allowJs": true, + "esModuleInterop...
9,407
diff --git /dev/null b/cli/tests/bundle_jsx.out new file mode 100644 --- /dev/null +++ b/cli/tests/bundle_jsx.out @@ -0,0 +1,10 @@ +[WILDCARD] +const React = { + createElement () { + } +}; +function app() { + return React.createElement("div", null, React.createElement("h2", null, "asdf")); +} +console.log(app)...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
CC @nayeemrmn probably related to formatting of errors Looks like the row number we get from the source mapper is mistakenly 28 instead of 25. Line 28 is obviously shorter than what the formatting code expects it to be given the `start_column` it received. So it's a source mapping bug as we've seen here and there recen...
2021-02-04T00:22:24Z
denoland/deno
denoland__deno-9394
[ "6965" ]
9069632216235dc92d3f2a4742cae7eb6102915b
Main thread panic at Error throw I'm experiencing a strange bug with `Deno`. When a exception is thrown the main process panics. This is the trace: ``` thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', cli\fmt_errors.rs:86:8 stack backtrace: 0: 0x7ff7af88a45b - <unknown> 1: ...
1.7
diff --git a/cli/program_state.rs b/cli/program_state.rs --- a/cli/program_state.rs +++ b/cli/program_state.rs @@ -296,12 +296,8 @@ impl SourceMapGetter for ProgramState { fn get_source_map(&self, file_name: &str) -> Option<Vec<u8>> { if let Ok(specifier) = ModuleSpecifier::resolve_url(file_name) { if le...
9,394
diff --git /dev/null b/cli/tests/083_legacy_external_source_map.ts new file mode 100644 --- /dev/null +++ b/cli/tests/083_legacy_external_source_map.ts @@ -0,0 +1,2 @@ +// - +throw new Error("foo"); diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs --- a/cli/tests/integration_tests.rs +++ b/c...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
2021-02-02T23:44:16Z
denoland/deno
denoland__deno-9380
[ "9364" ]
9690ce5e872f1873538b8cea7c93fa3ea8bfd9d1
"Unable to build http client error message" when specifying CA Cert using --cert I'm trying to run deno behind a corporate proxy, but running into a blocker regarding our certificates / proxy setup. I try to run the base command straight out (HTTPS_PROXY:PORT is using my correct proxy, masked for this issue - but the v...
1.7
diff --git a/cli/http_util.rs b/cli/http_util.rs --- a/cli/http_util.rs +++ b/cli/http_util.rs @@ -34,8 +34,9 @@ pub fn create_http_client( builder .build() - .map_err(|_| generic_error("Unable to build http client")) + .map_err(|e| generic_error(format!("Unable to build http client: {}", e))) } + ///...
9,380
diff --git a/runtime/http_util.rs b/runtime/http_util.rs --- a/runtime/http_util.rs +++ b/runtime/http_util.rs @@ -28,7 +28,7 @@ pub fn create_http_client( builder .build() - .map_err(|_| generic_error("Unable to build http client")) + .map_err(|e| generic_error(format!("Unable to build http client: {}"...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
The permissions prompts would go some way to alleviating the frustrating UX I described in #3655. We have `permissions.query()` API for checking the current API state. If we check and verify all the permissions at the start of the program, we can avoid frustrating situations like the example described in #3655. I th...
2021-02-02T19:48:41Z
denoland/deno
denoland__deno-9376
[ "3811" ]
06b5959eed5bd634851cd52dc24dca51e48d32de
discussion: Bring back permission prompt behind a flag Before https://github.com/denoland/deno/pull/3183 Deno was prompting for permission if one was missing. This functionality could have been disabled using `--no-prompt` flag. After that patch, an error is always thrown if permission is missing, the only way to prom...
1.8
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -516,7 +516,7 @@ impl FileFetcher { fn fetch_remote( &self, specifier: &ModuleSpecifier, - permissions: &Permissions, + permissions: &mut Permissions, redirect_limit: i64, ) -> Pin<Bo...
9,376
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -718,7 +718,7 @@ mod tests { async fn test_fetch(specifier: &ModuleSpecifier) -> (File, FileFetcher) { let (file_fetcher, _) = setup(CacheSetting::ReloadAll, None); let result = file_fetcher - ...
b9f758d3ad6b71d9ac7bcae7192985a1f9258724
2021-01-30T17:41:37Z
denoland/deno
denoland__deno-9332
[ "9446" ]
1f9e9002d527022130e4deba0b34b1ba466216d8
Uncaught (in promise) ReferenceError: Deno is not defined - when deno namespace is set to false in WebWorker Don`t know how to reproduce this for now, but using a worker without deno namespace set to true is not possible for now, in some situations. I mean it makes sense in the context that the error message is buil...
1.7
diff --git a/op_crates/fetch/11_streams.js b/op_crates/fetch/11_streams.js --- a/op_crates/fetch/11_streams.js +++ b/op_crates/fetch/11_streams.js @@ -7,8 +7,6 @@ "use strict"; ((window) => { - const customInspect = Symbol.for("Deno.customInspect"); - class AssertionError extends Error { constructor(msg) {...
9,332
diff --git /dev/null b/cli/tests/084_worker_custom_inspect.ts new file mode 100644 --- /dev/null +++ b/cli/tests/084_worker_custom_inspect.ts @@ -0,0 +1,4 @@ +new Worker( + new URL("084_worker_custom_inspect_worker.ts", import.meta.url).href, + { type: "module" }, +); diff --git /dev/null b/cli/tests/084_worker_custo...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f
depends on #3530 (replace libdeno with rusty_v8) @ry, @piscisaureus and I discussed this issue at length and decided that structured clone is not gonna make it to 1.0. We need to update docs accordingly as well as `postMessage()` method to try and discover if passed value can be JSON-stringified (eg. posting `Map` ...
2021-01-29T18:45:00Z
denoland/deno
denoland__deno-9323
[ "3557" ]
7a9ebd15852eee7b676a671098d63bece679e0f7
Implement proper structured cloning between Workers This is actually #3317, but we need a clearer issue name for tracking purposes. Structured cloning implementation might be very useful in ways for transferring tasks between `Worker`s for load balancing, through low-cost transfer of `ArrayBuffer` (or even `SharedAr...
1.9
diff --git a/core/bindings.rs b/core/bindings.rs --- a/core/bindings.rs +++ b/core/bindings.rs @@ -553,7 +553,7 @@ fn deserialize( match value { Some(deserialized) => rv.set(deserialized), None => { - let msg = v8::String::new(scope, "string too long").unwrap(); + let msg = v8::String::new(scope,...
9,323
diff --git a/cli/bench/main.rs b/cli/bench/main.rs --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -75,7 +75,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[ &[ "run", "--allow-read", - "cli/tests/workers_large_message_bench.ts", + "cli/tests/workers/bench_large_mess...
d21380728f7d16f1a5b7362b2e2b5c46ff8a8070
I'm working on it. This is essential when we support JSON modules.
2021-01-27T06:09:43Z
denoland/deno
denoland__deno-9292
[ "9268" ]
c0f10e72ee64f1512e6aff20a841f4696e774217
feat: add json support to deno fmt Since dprint supports json formatting also, it would be nice to see something in `deno fmt`. One extension less to install. :) Ref #7352
1.7
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -411,6 +411,7 @@ dependencies = [ "deno_web", "deno_websocket", "dissimilar", + "dprint-plugin-json", "dprint-plugin-markdown", "dprint-plugin-typescript", "encoding_rs", diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Car...
9,292
diff --git a/.dprintrc.json b/.dprintrc.json --- a/.dprintrc.json +++ b/.dprintrc.json @@ -23,6 +23,7 @@ "cli/tests/encoding", "cli/tests/inline_js_source_map*", "cli/tests/badly_formatted.md", + "cli/tests/badly_formatted.json", "cli/tsc/*typescript.js", "test_util/std", "test_util/wpt...
dbdbe7a1cf0d56df85305eb3638bc177d8a0216f