Bug 273572
Summary: | Web Inspector: await is not supported in console in some scenarios | ||
---|---|---|---|
Product: | WebKit | Reporter: | Tim Guan-tin Chien [:timdream] <timdream> |
Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | inspector-bugzilla-changes, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 17 | ||
Hardware: | All | ||
OS: | All |
Tim Guan-tin Chien [:timdream]
The following works:
```
const a = await Promise.resolve("hi");
```
The following does not, if I paste the lines and run it at once:
```
const a = await Promise.resolve("hi");
console.log(a);
```
neither does this:
```
console.log(await Promise.resolve("hi"));
```
Safari Version 17.5 (19618.2.2.1)
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/127381329>
Tim Guan-tin Chien [:timdream]
Expected result for the not working case is for console to print "hi".
The first not working case prints the following error:
SyntaxError: Unexpected identifier 'Promise'. Expected ';' after variable declaration
The second one prints:
SyntaxError: Unexpected identifier 'Promise'. Expected ')' to end an argument list.