Comments (3)
Fixed, i forgot to handle the async keyword when rendering objects methods. Thank you for reporting.
from peast.
We faced this on the project with AlpineJS. Basically, code was something like:
Alpine.data('foo', () => ({
async bar() {
await Baz.bar();
}
}))
This worked fine until Drupal 10.1 update, which introduced Peast as JS optimizer.
We updated our code to be:
Alpine.data('foo', () => ({
bar: async () => {
await Baz.bar();
}
}))
This solves the problem, but seems like a bug, because the first example is also a valid JS syntax. Peast removes async from bar()
and browser fails with await
notation without async
for function.
Maybe this information will be more helpful with an exact problem, rather than synthetic from a test.
from peast.
Thanks for the quick response and release! We'll try to get this into the next patch version of Drupal core.
from peast.
Related Issues (20)
- Cannot parse newline in string argument HOT 2
- Issues parsing comments in JSX HOT 1
- Issues parsing React Fragment short syntax HOT 1
- Formatter/Compact bug HOT 1
- Incorrect parsing of return statements with multi line template literals HOT 1
- Parse error with question mark followed by dot in ternary operator HOT 4
- Question: Known to PHP transpilers HOT 2
- Fails to parse some JS HOT 6
- Security Policy questions HOT 3
- Customize the grammar a bit? HOT 1
- Fatal error when xdebug enabled HOT 3
- wp i18n make-pot (WordPress) failing to parse specific JavaScript code HOT 3
- Failed to parse specific js code HOT 1
- Question: Is it possible to query by key name? HOT 4
- Utils::quoteLiteralString escapes \uFFF characters HOT 3
- Generating optimized autoload files error → Could not scan for classes inside HOT 2
- Parsing issue HOT 2
- Required block brackets are removed on case statements HOT 1
- Parser chokes on a method named async HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from peast.