宪法Chaff-Rejected 建议1787年的宪法惯例。 Constitutional chaff.: Rejected suggestions of the Constitutional Convention of 1787, with explanatory argument. Promise存在三种状态:挂起,fulfilled和rejected 。 Promises have three states: pending, fulfilled, and rejected . 设计这些事件的目的是为了帮助辨识未处理的rejected 状态的promise。 These events are designed to work together to help identify promises that are rejected and not handled. 一旦Promise变成了Fulfilled或Rejected ,则无法再转化为任何其他状态了。 Once a promise is fulfilled or rejected , it cannot be changed to any other state. 一旦Promise处于fulfilled或者rejected 状态,就再不能转换为其它任何状态。 Once a promise is fulfilled or rejected , it cannot be changed to any other state.
如果x处于pending状态,则promise必须保持pending状态直到x的状态变成fulfilled或rejected 。 If x is pending, promise must remain pending until x is fulfilled or rejected . 如果出现错误,promise的状态变为“rejected ”,此时执行程序应该跳转到最近的rejection处理程序。 In case of an error, the promise state becomes“rejected ”, and the execution should jump to the closest rejection handler. 拒绝使用或停止使用有关方法/产品的原因Reasonwhytheuseofthemethod/productwasrejected orstopped. Reason why the use of the method/product was rejected or stopped. 这个区别虽不易察觉但至关重要,因为p2若处于rejected 状态则第二个fulfillment处理不会被调用。 This is a subtle but important distinction, as the second fulfillment handler will not be called if p2 is rejected . 宪法Chaff-Rejected 建议1787年的宪法惯例。 Constitutional Chaff: Rejected Suggestions of the Constitutional Convention of 1787, with…. Rejected -异步操作失败,promise永远不会实现。Rejected - the asynchronous operation failed, and the promise will never be fulfilled.Promise有三种状态:pending,resolved,rejected 。 A promise has 3 states: pending, resolved, rejected . 改变promise内部状态为'rejected '. Change approval status to“Reject ”. 在fetch不可能发出请求时会返回rejected 状态的promise。 The promise returned by fetch rejects when it's impossible to make a request. 该例中,因为p2的状态是rejected ,所以第二个fulfillment处理永远不会被调用。 In this example, the second fulfillment handler is never called because p2 is rejected . 相反,如果p2的状态是rejected ,那么rejection处理(如果存在)会被调用。 If p2 were rejected , a rejection handler(if present) would be called instead of the second fulfillment handler. 如果OnReject不是一个函数且promise1已经rejected ,则promise2必须以相同的reason被拒绝. If onRejected is not a function and promise1 is rejected , promise2 must be rejected with the same reason as promise1. 如果onRejected不是一个function,而且promise1是rejected ,那么promise2也必须以相同的原因被rejected . If onRejected is not a function and promise1 is rejected , promise2 must be rejected with the same reason as promise1. 然而,一旦promise得到fulfilled或rejected ,它将永远不会过渡到任何其他状态,其value或失败原因不会改变。 Once a promise is fulfilled or rejected , however, it will never transition to any other state, and its value or failure reason will not change. 如果Promise状态为rejected ,那么步骤将失败,如果Promise状态为fulfilled,则步骤将会成功。 If the Promise is rejected then the step will have failed, and if the Promise is fulfilled then the step will have succeeded.
Display more examples
Results: 55 ,
Time: 0.0196