Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/async/   (Firefox Browser 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 in Prozent
C=95 H=92 G=93

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.