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.compile panic again, easy to reproduce #6908

Closed
sdhoward opened this issue Jul 28, 2020 · 1 comment · Fixed by #6909
Closed

Deno.compile panic again, easy to reproduce #6908

sdhoward opened this issue Jul 28, 2020 · 1 comment · Fixed by #6909
Assignees
Labels
bug Something isn't working correctly

Comments

@sdhoward
Copy link

Hi, thanks for working on a previous issue #6747. I found another case that you may want to have a look at.

Again, I know the code being submitted to the compiler is invalid; however, I want Deno to tell me that instead of panicing.

Thanks!

Deno version:

deno 1.2.1
v8 8.5.216
typescript 3.9.2

Example code:

Deno.compile("main.js", { "main.js": `
export class Foo {
  constructor() {
    console.log("foo");
  }
  export get() {
    console.log("bar");
  }
}
`});

Attempted compile with:

$ deno run --unstable foo.js

thread 'main' panicked at 'Can't downcast ErrBox(SwcDiagnosticBuffer { diagnostics: ["Unexpected token Some(Word(get)) at memory://main.js:6:9"] }) to OpError', cli/op_error.rs:423:9

Also, if you have a recommendation for a third party module that might be able to pre-parse code to filter out cases like these I'd be happy to hear about it.

@bartlomieju
Copy link
Member

@sdhoward thanks for reporting that, it should be an easy fix, I'll try to get it released in v1.2.2 in the next days.

@bartlomieju bartlomieju added the bug Something isn't working correctly label Jul 28, 2020
@bartlomieju bartlomieju self-assigned this Jul 28, 2020
@ry ry closed this as completed in #6909 Jul 28, 2020
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants