litble/Multi-Docker-Eval huggingface dataset:
Repository: pinojs/pino-pretty (javascript)

Issue:
Backslashes escaped in object values
I am logging [polylines](https://developers.google.com/maps/documentation/javascript/examples/polyline-simple) which include the character `\`. When I try to log them, it escapes the backslash as it's JSON encoding the value. e.g.

```
pino.info({ polyline: '\\' })
```

outputs `polyline: "\\"`, when it would be more correct to output `polyline: "\"`

An extra `\` can mess up the shape of the polyline e.g.

```
{o_uIzhvS?P_@VcAr@u@j@[\\QDKAUQISb@sDAe@Ai@G[GCWC_@KSIWSAQ
```

```
{o_uIzhvS?P_@VcAr@u@j@[\QDKAUQISb@sDAe@Ai@G[GCWC_@KSIWSAQ
```

Thanks :)


Discussion:
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

Patch:
diff --git a/lib/utils.js b/lib/utils.js
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -405,16 +405,21 @@ function prettifyObject ({
       result += colorizer.greyMessage(stringifySafe(plain))
     }
     result += eol
+    // Avoid printing the escape character on escaped backslashes.
+    result = result.replace(/\\\\/gi, '\\')
   } else {
     // Put each object entry on its own line
     Object.entries(plain).forEach(([keyName, keyValue]) => {
       // custom prettifiers are already applied above, so we can skip it now
-      const lines = typeof customPrettifiers[keyName] === 'function'
+      let lines = typeof customPrettifiers[keyName] === 'function'
         ? keyValue
         : stringifySafe(keyValue, null, 2)
 
       if (lines === undefined) return
 
+      // Avoid printing the escape character on escaped backslashes.
+      lines = lines.replace(/\\\\/gi, '\\')
+
       const joinedLines = joinLinesWithIndentation({ input: lines, ident, eol })
       result += `${ident}${keyName}:${joinedLines.startsWith(eol) ? '' : ' '}${joinedLines}${eol}`
     })


Test patch:
diff --git a/test/lib/utils.public.test.js b/test/lib/utils.public.test.js
--- a/test/lib/utils.public.test.js
+++ b/test/lib/utils.public.test.js
@@ -270,6 +270,16 @@ tap.test('prettifyObject', t => {
     t.equal(str, '    foo: "bar"\n')
   })
 
+  t.test('ignores escaped backslashes in string values', async t => {
+    const str = prettifyObject({ input: { foo_regexp: '\\[^\\w\\s]\\' } })
+    t.equal(str, '    foo_regexp: "\\[^\\w\\s]\\"\n')
+  })
+
+  t.test('ignores escaped backslashes in string values (singleLine option)', async t => {
+    const str = prettifyObject({ input: { foo_regexp: '\\[^\\w\\s]\\' }, singleLine: true })
+    t.equal(str, '{"foo_regexp":"\\[^\\w\\s]\\"}\n')
+  })
+
   t.test('works with error props', async t => {
     const err = Error('Something went wrong')
     const serializedError = {
Repository: prettier/plugin-ruby (javascript)

Issue:
Don't allow scope resolution operator to be split up
This fixes a bad interaction between `rescue` and the top scope resolution operator.  Without this fix, this code:

```ruby
def foo
  a
rescue ::A
  e
end
```

will become:

```ruby
def foo
  a
rescue ::, A
  e
end
```


Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
 - [#993](https://github.com/prettier/plugin-ruby/pull/993) - kddnewton - Nicer error message if you don't have the necessary JavaScript files to run prettier.
 - [#996](https://github.com/prettier/plugin-ruby/pull/996) - nbudin - Allow `@prettier/plugin-ruby` to run in yarn's plug'n'play mode.
 
+### Changed
+
+- [#1000](https://github.com/prettier/plugin-ruby/pull/1000) - nbudin, kddnewton - Fix for rescuing single top-level exceptions in `rescue` clauses.
+
 ## [2.0.0-rc3]
 
 ### Changed
diff --git a/src/ruby/nodes/rescue.ts b/src/ruby/nodes/rescue.ts
--- a/src/ruby/nodes/rescue.ts
+++ b/src/ruby/nodes/rescue.ts
@@ -55,14 +55,17 @@ export const printRescueEx: Plugin.Printer<Ruby.RescueEx> = (
   print
 ) => {
   const [exception, variable] = path.getValue().body;
-  const parts = [];
+  const parts: Plugin.Doc[] = [];
 
   if (exception) {
+    // If there's just one exception being rescued, then it's just going to be a
+    // single doc node.
     let exceptionDoc = path.call(print, "body", 0);
 
-    if (Array.isArray(exceptionDoc)) {
-      const joiner = [",", line];
-      exceptionDoc = group(join(joiner, exceptionDoc));
+    // If there are multiple exceptions being rescued, then we're going to have
+    // multiple doc nodes returned as an array that we need to join together.
+    if (["mrhs_add_star", "mrhs_new_from_args"].includes(exception.type)) {
+      exceptionDoc = group(join([",", line], exceptionDoc));
     }
 
     parts.push(" ", exceptionDoc);


Test patch:
diff --git a/test/js/ruby/nodes/rescue.test.ts b/test/js/ruby/nodes/rescue.test.ts
--- a/test/js/ruby/nodes/rescue.test.ts
+++ b/test/js/ruby/nodes/rescue.test.ts
@@ -38,6 +38,19 @@ describe("rescue", () => {
     expect(content).toMatchFormat();
   });
 
+  // https://github.com/prettier/plugin-ruby/pull/1000
+  test("errors with scope resolution operator", () => {
+    const content = ruby(`
+      def foo
+        a
+      rescue ::A
+        e
+      end
+    `);
+
+    expect(content).toMatchFormat();
+  });
+
   test.each(["begin", "def foo"])("%s with every clause", (declaration) => {
     const error = "BreakingBreakingBreakingBreakingBreakingError";
     const content = ruby(`
Repository: vercel/nft (javascript)

Issue:
Trace entry files without extension
Currently files passed to `nodeFileTrace` without extension are not traced beacuse of this line

https://github.com/vercel/nft/blob/f146d3cce10ef1bc9af9bea7778152a150c60c88/src/node-file-trace.ts#L40

However it is common for files that end up in .bin directory to not have an extension (and also to have `#!/usr/bin/env node` on top, which already works), these files are still js code but they don't have the 'js' extension

The following will not trace the files dependencies because `next/dist/bin/next` does not have an extension
```ts
await nodeFileTrace([require.resolve('next/dist/bin/next')])
```


Discussion:
We might need to peek in the file contents to check if the first line contains a hash bang.

@guybedford Could we remove this `if` statement since it seems like the caller should avoid calling `nodeFileTrace()` for non-JS files, right? 
The reason for this is that Node.js in ESM mode doesn't execute files without an extension, although it does in CJS mode.

We could perhaps add an exception for the initial entry point specifically (`isMain` kind of thing, which is fairly common).

Patch:
diff --git a/src/node-file-trace.ts b/src/node-file-trace.ts
--- a/src/node-file-trace.ts
+++ b/src/node-file-trace.ts
@@ -33,10 +33,7 @@ export async function nodeFileTrace(files: string[], opts: NodeFileTraceOptions
   await Promise.all(files.map(async file => {
     const path = resolve(file);
     await job.emitFile(path, 'initial');
-    if (path.endsWith('.js') || path.endsWith('.cjs') || path.endsWith('.mjs') || path.endsWith('.node') || job.ts && (path.endsWith('.ts') || path.endsWith('.tsx'))) {
-      return job.emitDependency(path);
-    }
-    return undefined;
+    return job.emitDependency(path);
   }));
 
   const result: NodeFileTraceResult = {


Test patch:
diff --git a/test/unit.test.js b/test/unit.test.js
--- a/test/unit.test.js
+++ b/test/unit.test.js
@@ -50,6 +50,9 @@ for (const { testName, isRoot } of unitTests) {
       let inputFileNames = ["input.js"];
       let outputFileName = "output.js";
       
+      if (testName === "jsx-input") {
+        inputFileNames = ["input.jsx"];
+      }
       if (testName === "tsx-input") {
         inputFileNames = ["input.tsx"];
       }
diff --git a/test/unit/jsx-input/dep.jsx b/test/unit/jsx-input/dep.jsx
new file mode 100644
--- /dev/null
+++ b/test/unit/jsx-input/dep.jsx
@@ -0,0 +1 @@
+export const dep = <h1>dep</h1>
\ No newline at end of file
diff --git a/test/unit/jsx-input/input.jsx b/test/unit/jsx-input/input.jsx
new file mode 100644
--- /dev/null
+++ b/test/unit/jsx-input/input.jsx
@@ -0,0 +1,3 @@
+import { readFileSync } from 'fs';
+
+readFileSync(__dirname + '/dep.jsx');
diff --git a/test/unit/jsx-input/output.js b/test/unit/jsx-input/output.js
new file mode 100644
--- /dev/null
+++ b/test/unit/jsx-input/output.js
@@ -0,0 +1,4 @@
+[
+  "test/unit/jsx-input/dep.jsx",
+  "test/unit/jsx-input/input.jsx"
+]
\ No newline at end of file
Repository: prettier/plugin-ruby (javascript)

Issue:
HAML attributes starting with `@` are incorrectly formatted
## Metadata

- Operating system: MacOS, Ubuntu (in Codespaces)
- Ruby version: latest
- Node version: latest
- `@prettier/plugin-ruby` or `prettier` gem version: latest
- Options:
  - `rubyArrayLiteral` - `true`
  - `rubyHashLabel` - `true`
  - `rubyModifier` - `true`
  - `rubySingleQuote` - `true`
  - `rubyToProc` - `false`
  - `trailingComma` - `"none"`

## Input

```haml
%span{'@click': 'open = true'}
```

## Current output

```ruby
%span{@click: 'open = true'}
```

## Expected output

```ruby
%span{'@click': 'open = true'}
```

## Context

Thanks for this project!

[AlpineJS](https://alpinejs.dev/) is a JavaScript framework we’re using in our Rails project, and makes extensive uses of “@-directives” like `@click`, `@change`, `@keydown`…

In HAML, such attributes need to be wrapped in quotes to be valid, however, this plugin strips them out. The attached PR (#1097) adds a failing spec to illustrate the issue and a tentative fix. This is my first contribution to this project, please let me know if I missed something!


Discussion:

Patch:
diff --git a/src/haml/parser.rb b/src/haml/parser.rb
--- a/src/haml/parser.rb
+++ b/src/haml/parser.rb
@@ -44,6 +44,12 @@ def parse_value(string, level = 0)
         if hash
           # Explicitly not using Enumerable#to_h here to support Ruby 2.5
           hash.each_with_object({}) do |(key, value), response|
+            # For attributes that starts with @, wrap the attribute in quotes
+            # For other attributes, remove the quotes
+            # AlpineJS uses @-attributes
+            # {'type': 'submit'} => {type: 'submit'}
+            # {'@click': 'open'} => {'@click': 'open'}
+            key = "\'#{key}\'" if key.start_with?('@')
             response[key] = parse_value(value, level + 1)
           end
         else


Test patch:
diff --git a/test/js/haml/tag.test.ts b/test/js/haml/tag.test.ts
--- a/test/js/haml/tag.test.ts
+++ b/test/js/haml/tag.test.ts
@@ -103,6 +103,10 @@ describe("tag", () => {
 
       expect(content).toChangeFormat(expected);
     });
+
+    test("attributes prefixed with @", () => {
+      expect(haml("%span{'@click': 'open = true'}")).toMatchFormat();
+    });
   });
 
   test("object reference", () => {
Repository: pinojs/pino-pretty (javascript)

Issue:
Typings missing `minimumLevel`
`minimumLevel` is a valid option here:
https://github.com/pinojs/pino-pretty/blob/e793e646a0b539b3a9aa8b5ab43e64a8d86b05d6/index.js#L57
But it's not available in the typings:
![](https://discord.coffee/29fkYzN.png)
Which I assume is because it isn't part of the default options set, so when the typings were written it was missed:
https://github.com/pinojs/pino-pretty/blob/e793e646a0b539b3a9aa8b5ab43e64a8d86b05d6/index.js#L30-L48

(psst... what is the default minimum level?)


Discussion:
Would you be open to send a PR for this? It would also need a tsd test.
Yep, just need to know what the default is for proper documentation.

Edt: Just seems to be trace. I'll PR this now.

Patch:
diff --git a/index.d.ts b/index.d.ts
--- a/index.d.ts
+++ b/index.d.ts
@@ -9,7 +9,7 @@
 import { Transform } from 'stream';
 import { OnUnknown } from 'pino-abstract-transport';
 // @ts-ignore fall back to any if pino is not available, i.e. when running pino tests
-import { DestinationStream } from 'pino';
+import { DestinationStream, Level } from 'pino';
 
 type LogDescriptor = Record<string, unknown>;
 
@@ -61,6 +61,11 @@ interface PrettyOptions_ {
    * @default "time"
    */
   timestampKey?: string;
+  /**
+   * The minimum log level to include in the output.
+   * @default "trace"
+   */
+  minimumLevel?: Level;
   /**
    * Format output of message, e.g. {level} - {pid} will output message: INFO - 1123
    * @default false


Test patch:
diff --git a/test/types/pino-pretty.test-d.ts b/test/types/pino-pretty.test-d.ts
--- a/test/types/pino-pretty.test-d.ts
+++ b/test/types/pino-pretty.test-d.ts
@@ -21,6 +21,7 @@ const options: PinoPretty.PrettyOptions = {
   levelFirst: false,
   messageKey: "msg",
   timestampKey: "timestamp",
+  minimumLevel: "trace",
   translateTime: "UTC:h:MM:ss TT Z",
   singleLine: false,
   customPrettifiers: {
@@ -47,6 +48,7 @@ const options2: PrettyOptions = {
   levelFirst: false,
   messageKey: "msg",
   timestampKey: "timestamp",
+  minimumLevel: "trace",
   translateTime: "UTC:h:MM:ss TT Z",
   singleLine: false,
   customPrettifiers: {
Repository: pinojs/pino-pretty (javascript)

Issue:
TypeScript declarations missing `destination` option
In `index.d.ts` the `PrettyOptions_` interface is missing the `destination` property.



Discussion:
Would you like to send a Pull Request to address this issue? Remember to add unit tests. We use tsd.
Yes I will submit a PR probably later this week when I have time, if not already done by someone else.

Patch:
diff --git a/Readme.md b/Readme.md
--- a/Readme.md
+++ b/Readme.md
@@ -252,7 +252,7 @@ The options accepted have keys corresponding to the options described in [CLI Ar
   // You can also configure some SonicBoom options directly
   sync: false, // by default we write asynchronously
   append: true, // the file is opened with the 'a' flag
-  mdkdir: true, // create the target destination
+  mkdir: true, // create the target destination
 
 
   customPrettifiers: {}
@@ -262,6 +262,9 @@ The options accepted have keys corresponding to the options described in [CLI Ar
 The `colorize` default follows
 [`colorette.isColorSupported`](https://github.com/jorgebucaran/colorette#iscolorsupported).
 
+The defaults for `sync`, `append`, `mkdir` inherit from
+[`SonicBoom(opts)`](https://github.com/pinojs/sonic-boom#API).
+
 `customPrettifiers` option provides the ability to add a custom prettify function
 for specific log properties. `customPrettifiers` is an object, where keys are
 log properties that will be prettified and value is the prettify function itself.
diff --git a/index.d.ts b/index.d.ts
--- a/index.d.ts
+++ b/index.d.ts
@@ -8,6 +8,7 @@
 
 import { Transform } from 'stream';
 import { OnUnknown } from 'pino-abstract-transport';
+import { DestinationStream } from 'pino';
 
 type LogDescriptor = Record<string, unknown>;
 
@@ -106,6 +107,21 @@ interface PrettyOptions_ {
    * @default false
    */
   sync?: boolean;
+  /**
+   * The file, file descriptor, or stream to write to.  Defaults to 1 (stdout).
+   * @default 1
+   */
+  destination?: string | number | DestinationStream | NodeJS.WritableStream;
+  /**
+   * Opens the file with the 'a' flag.
+   * @default true
+   */
+  append?: boolean;
+  /**
+   * Ensure directory for destination file exists.
+   * @default false
+   */
+  mkdir?: boolean;
   /**
    * Provides the ability to add a custom prettify function for specific log properties.
    * `customPrettifiers` is an object, where keys are log properties that will be prettified


Test patch:
diff --git a/test/types/pino-pretty.test-d.ts b/test/types/pino-pretty.test-d.ts
--- a/test/types/pino-pretty.test-d.ts
+++ b/test/types/pino-pretty.test-d.ts
@@ -29,6 +29,8 @@ const options: PinoPretty.PrettyOptions = {
     }
   },
   sync: false,
+  append: true,
+  mkdir: true,
 };
 
 const options2: PrettyOptions = {
@@ -52,6 +54,8 @@ const options2: PrettyOptions = {
     }
   },
   sync: false,
+  append: true,
+  mkdir: true,
 };
 
 expectType<PrettyStream>(pretty(options));
Repository: pinojs/pino-pretty (javascript)

Issue:
timestamp: false results in empty []
Hiya! I'm trying out `pino(-pretty)` and encountered an unexpected rendering. Here's what I'm seeing in my console:

```
[] INFO  (my-logger): test
```

And here's the code to generate it:

```js
const logger = pino({
  base: { name: my-logger },
  prettyPrint: true,
  timestamp: false
})

logger.info('test')
```

It looks like `timestamp` being set to false is properly omitting it from the log, but the `[<timestamp>]` square brackets are still being printed. As a library user, I would expect the square brackets to also be omitted, and to see this as the output:

```
INFO  (my-logger): test
```

Let me know if I'm doing something weird or if there's anything I can do to help! ✨ 

<details>
<summary>Versions</summary>

```
❯ node -v
v10.13.0

❯ npm list pino pino-pretty
├── pino@5.9.0
└── pino-pretty@2.3.0
```
</details>


Discussion:
Judging by this test, it looks like this might be expected behavior:

https://github.com/pinojs/pino-pretty/blob/8101d3bf5b31b05ea608160e56b01b2b44b2c0f1/test/basic.test.js#L273-L284

With that in mind, would y'all be open to a PR that modifies the test (and behavior)?

```diff
-    t.is(formatted, `[undefined] INFO  (${pid} on ${hostname}): hello world\n`)
+    t.is(formatted, `INFO  (${pid} on ${hostname}): hello world\n`)
```
Yep. Go for it. 

Patch:
diff --git a/index.js b/index.js
--- a/index.js
+++ b/index.js
@@ -120,7 +120,7 @@ module.exports = function prettyFactory (options) {
       log.time = formatTime(log.time, opts.translateTime)
     }
 
-    var line = `[${log.time}]`
+    var line = log.time ? `[${log.time}]` : ''
 
     const coloredLevel = levels.hasOwnProperty(log.level)
       ? color[log.level](levels[log.level])
@@ -128,7 +128,10 @@ module.exports = function prettyFactory (options) {
     if (opts.levelFirst) {
       line = `${coloredLevel} ${line}`
     } else {
-      line = `${line} ${coloredLevel}`
+      // If the line is not empty (timestamps are enabled) output it
+      // with a space after it - otherwise output the empty string
+      const lineOrEmpty = line && line + ' '
+      line = `${lineOrEmpty}${coloredLevel}`
     }
 
     if (log.name || log.pid || log.hostname) {


Test patch:
diff --git a/test/basic.test.js b/test/basic.test.js
--- a/test/basic.test.js
+++ b/test/basic.test.js
@@ -276,7 +276,7 @@ test('basic prettifier tests', (t) => {
     const log = pino({ timestamp: null }, new Writable({
       write (chunk, enc, cb) {
         const formatted = pretty(chunk.toString())
-        t.is(formatted, `[undefined] INFO  (${pid} on ${hostname}): hello world\n`)
+        t.is(formatted, `INFO  (${pid} on ${hostname}): hello world\n`)
         cb()
       }
     }))
Repository: prettier/plugin-ruby (javascript)

Issue:
Strips quotes from hash key containing backslashes
## Metadata

- Operating system: MacOS
- Ruby version: `ruby 2.6.3p62`
- Node version: `v16.3.0`
- `@prettier/plugin-ruby` or `prettier` gem version: `1.6.0`
- Options: defaults

## Input

```ruby
{ '\d': 1 }
```

## Output

```ruby
{ \d: 1 }
```

... which is a syntax error with 2.6:
```test.rb:1: syntax error, unexpected backslash, expecting '}'```

FWIW this was working fine in 1.5.2.



Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
 - [#863](https://github.com/prettier/plugin-ruby/issues/863) - azz, kddeisz - Fix up Sorbet `sig` block formatting when chaining method calls.
 - [#908](https://github.com/prettier/plugin-ruby/issues/908) - Hansenq, kddeisz - Method chains with blocks should be properly indented.
 - [#916](https://github.com/prettier/plugin-ruby/issues/916) - pbrisbin, kddeisz - Ensure all of the necessary files are present in the gem.
+- [#917](https://github.com/prettier/plugin-ruby/issues/917) - jscheid, kddeisz - Ensure hash keys with dynamic symbols don't strip their quotes.
 
 ## [1.6.0] - 2021-06-23
 
diff --git a/src/ruby/nodes/strings.js b/src/ruby/nodes/strings.js
--- a/src/ruby/nodes/strings.js
+++ b/src/ruby/nodes/strings.js
@@ -152,8 +152,10 @@ function printDynaSymbol(path, opts, print) {
   if (isQuoteLocked(node)) {
     if (node.quote.startsWith("%")) {
       quote = opts.rubySingleQuote ? "'" : '"';
-    } else {
+    } else if (node.quote.startsWith(":")) {
       quote = node.quote.slice(1);
+    } else {
+      quote = node.quote;
     }
   } else {
     quote = opts.rubySingleQuote && isSingleQuotable(node) ? "'" : '"';


Test patch:
diff --git a/test/js/globalSetup.js b/test/js/globalSetup.js
--- a/test/js/globalSetup.js
+++ b/test/js/globalSetup.js
@@ -9,7 +9,7 @@ process.env.RUBY_VERSION = spawnSync("ruby", args).stdout.toString().trim();
 // it to get back the AST.
 function globalSetup() {
   if (!process.env.PRETTIER_RUBY_HOST) {
-    process.env.PRETTIER_RUBY_HOST = `/tmp/prettier-ruby-test-${process.id}.sock`;
+    process.env.PRETTIER_RUBY_HOST = `/tmp/prettier-ruby-test-${process.pid}.sock`;
   }
 
   global.__ASYNC_PARSER__ = spawn("ruby", [
diff --git a/test/js/ruby/nodes/strings.test.js b/test/js/ruby/nodes/strings.test.js
--- a/test/js/ruby/nodes/strings.test.js
+++ b/test/js/ruby/nodes/strings.test.js
@@ -196,6 +196,9 @@ describe("strings", () => {
         rubySingleQuote: false
       }));
 
+    test("symbol literal as a hash key", () =>
+      expect("{ '\\d' => 1 }").toMatchFormat());
+
     test("%s literal with newlines", () => {
       const content = ruby(`
         a = %s[
Repository: vercel/nft (javascript)

Issue:
Add support for `top-level await`
just noticed an Error in `warnings`:
```
Error: Failed to parse xxx.js as module:
Cannot use keyword 'await' outside an async function
    at Object.analyze [as default] ...
```

it already supported in node>=14.8.0, so i think there will be more and more projects using top-level await in the future.


Discussion:
Looks like we need to pass [allowAwaitOutsideFunction](https://github.com/acornjs/acorn/tree/master/acorn#interface) to acorn.

Would you like to submit a PR with a test to fix this?

Patch:
diff --git a/src/analyze.ts b/src/analyze.ts
--- a/src/analyze.ts
+++ b/src/analyze.ts
@@ -251,7 +251,7 @@ export default async function analyze(id: string, code: string, job: Job): Promi
   //@ts-ignore
   if (!ast) {
     try {
-      ast = acorn.parse(code, { ecmaVersion: 2020, sourceType: 'module' });
+      ast = acorn.parse(code, { ecmaVersion: 2020, sourceType: 'module', allowAwaitOutsideFunction: true });
       isESM = true;
     }
     catch (e) {
@@ -837,7 +837,7 @@ export default async function analyze(id: string, code: string, job: Job): Promi
     }
 
     if ('value' in staticChildValue && isAbsolutePathOrUrl(staticChildValue.value)) {
-      try { 
+      try {
         const resolved = resolveAbsolutePathOrUrl(staticChildValue.value);
         emitAssetPath(resolved);
       }
@@ -855,7 +855,7 @@ export default async function analyze(id: string, code: string, job: Job): Promi
     }
     else if (staticChildNode && staticChildNode.type === 'ArrayExpression' && 'value' in staticChildValue && staticChildValue.value instanceof Array) {
       for (const value of staticChildValue.value) {
-        try { 
+        try {
           const resolved = resolveAbsolutePathOrUrl(value);
           emitAssetPath(resolved);
         }


Test patch:
diff --git a/test/unit/top-level-await/input.js b/test/unit/top-level-await/input.js
new file mode 100644
--- /dev/null
+++ b/test/unit/top-level-await/input.js
@@ -0,0 +1,3 @@
+import {dep} from './module';
+
+await Promise.resolve(console.log(dep));
diff --git a/test/unit/top-level-await/module.js b/test/unit/top-level-await/module.js
new file mode 100644
--- /dev/null
+++ b/test/unit/top-level-await/module.js
@@ -0,0 +1 @@
+export const dep = 'dep';
\ No newline at end of file
diff --git a/test/unit/top-level-await/output.js b/test/unit/top-level-await/output.js
new file mode 100644
--- /dev/null
+++ b/test/unit/top-level-await/output.js
@@ -0,0 +1,5 @@
+[
+  "package.json",
+  "test/unit/top-level-await/input.js",
+  "test/unit/top-level-await/module.js"
+]
\ No newline at end of file