Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno crash when specifying sourceURL comment during async code evaluation. #24782

Closed
garethj2 opened this issue Jul 29, 2024 · 2 comments · Fixed by denoland/deno_core#856 or #24839
Closed
Assignees
Labels
bug Something isn't working correctly deno_core Changes in "deno_core" crate are needed

Comments

@garethj2
Copy link

Version: Deno 1.45.4

Run this code and Deno will crash...

const AsyncFunction = Object.getPrototypeOf(async function () {
	// empty
}).constructor

const func = new AsyncFunction(
	`return doesNotExist();
    //# sourceURL=empty.eval`
)

func.call({})

...with this output...

Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos aarch64
Version: 1.45.4
Args: ["deno", "run", "crash.ts"]

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.299.0/error.rs:1245:36:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

To resolve, simply remove the sourceURL line. Now it'll fail as expected.

@bartlomieju bartlomieju added the bug Something isn't working correctly label Jul 29, 2024
@bartlomieju bartlomieju self-assigned this Jul 29, 2024
@bartlomieju
Copy link
Member

Most likely will be addressed by denoland/deno_core#819

@bartlomieju
Copy link
Member

Let's keep this one open until we upgrade deno_core to a version that contains the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly deno_core Changes in "deno_core" crate are needed
Projects
None yet
3 participants