-
```js
/**
* 本质就是then,只是少传了一个onFulfilled
* 所以仅处理失败的场景
* @param {*} onRejected
*/
Promise.prototype.catch = function(onRejected) {
return this.then(null, onRejected);
}
```
-
It would be nice to have a typed response.
Eg.
```
{
audio_base64: string;
alignment: {
characters: Array;
character_start_times_seconds: Array;
character_end_times_seconds: …
-
Promise 是异步(async)编程的一种解决方案
Promise有三种状态
1. pending: 初始状态,既不是成功,也不是失败状态。
2. fulfilled: 意味着操作成功完成。
3. rejected: 意味着操作失败。
-
## Describe the bug
After the changes introduced to the `client-utils` package in PR #10566, the `readFully` method from the Agoric client-utils package fails when attempting to read a vstorage node.…
-
### What version of Bun is running?
1.1.31-debug
### What platform is your computer?
Linux 6.11.0-400.asahi.fc40.aarch64+16k aarch64 unknown
### What steps can reproduce the bug?
```javascript
im…
-
See https://github.com/Agoric/agoric-sdk/pull/2909#pullrequestreview-638818141
Also, @dtribble please explain the Midori four vat promise shortening case.
-
`
```
class MyPromise {
constructor(executor) {
// 初始状态为 pending,结果值和拒因值为 undefined
this.state = 'pending';
this.value = undefined;
this.reason = …
-
- promise.js
``` js
class PromiseSimple {
constructor(executionFunction) {
this.promiseChain = [];
this.handleError = () => {};
this.onResolve = this.onResolve.bind(this)…
phymo updated
5 months ago
-
When executing JavaScript code containing asynchronous operations (e.g., async/await), the e2b Sandbox environment fails to execute the code as expected. Instead of resolving the asynchronous function…
-
related: https://github.com/neovim/neovim/issues/11312
## Problem
There's no builtin abstraction for:
- Representing a task.
- Example: `vim.system()` returns its own ad-hoc "task" that can be …