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

fix: dynamic import panic #2792

Merged
merged 10 commits into from Aug 21, 2019

Conversation

@bartlomieju
Copy link
Contributor

commented Aug 18, 2019

Reproduction:

// dyn_import_panic.ts

async function main() {
  const root = `file://${Deno.cwd()}/`;
  await import(root + "foo.js");
  await import(root + "README.md");
}

main();

This panic occurred only if there was error for 2nd and following dynamic imports.

Before:

thread 'tokio-runtime-worker-1' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`', ../../core/isolate.rs:507:7
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
thread 'main' panicked at 'internal error: entered unreachable code', ../../third_party/rust_crates/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.22/src/runtime/threadpool/mod.rs:296:26
thread 'tokio-runtime-worker-2' panicked at 'unexpected state while aborting task: Complete', ../../third_party/rust_crates/registry/src/github.com-1ecc6299db9ec823/tokio-threadpool-0.1.15/src/task/mod.rs:216:21
^C

After:

error: Uncaught SyntaxError: Invalid or unexpected token
► file:///Users/biwanczuk/dev/deno/README.md:1:1

1 # deno
  ^

CC @ry

@bartlomieju bartlomieju force-pushed the bartlomieju:fix-dynamic_import_panic branch from 57a796d to 8d0ea91 Aug 18, 2019

bartlomieju added 5 commits Aug 18, 2019

@bartlomieju bartlomieju reopened this Aug 19, 2019

core/isolate.rs Show resolved Hide resolved
tests/043_dyn_import_error.ts Outdated Show resolved Hide resolved
core/isolate.rs Show resolved Hide resolved
core/isolate.rs Show resolved Hide resolved
@ry
Copy link
Collaborator

left a comment

Marking this with "request changes" so it doesn't get accidentally landed without a test.

@ry
ry approved these changes Aug 21, 2019
Copy link
Collaborator

left a comment

LGTM - : )

@ry ry merged commit b764d1b into denoland:master Aug 21, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details

@bartlomieju bartlomieju deleted the bartlomieju:fix-dynamic_import_panic branch Aug 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.