Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/async/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 712 B image not shown  

Quelle  ecma262-issue-1461.js   Sprache: JAVA

 
// <https://github.com/tc39/ecma262/pull/1470> changes a detail of
// error-handling in %AsyncFromSyncIteratorPrototype% methods. This test is
// based on a comment in the thread where the issue was first reported,
// <https://github.com/tc39/ecma262/issues/1461#issuecomment-468602852>

let log = [];

{
  async function f() {
    var p = Promise.resolve(0);
    Object.defineProperty(p, "constructor", {get() { throw "hi" }});
    for await (var x of [p]);
  }
  Promise.resolve(0)
         .then(() => log.push("tick 1"))
         .then(() => log.push("tick 2"))
         .then(() => log.push("tick 3"));
  f().catch(exc => log.push(exc));
}

drainJobQueue();
assertEq(log.join(), "tick 1,tick 2,hi,tick 3");

Messung V0.5
C=92 H=100 G=95

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.