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

Quelle  Script-sourceStart-04.js   Sprache: JAVA

 
/*
 * For eval and Function constructors, Script.prototype.sourceStart and
 * Script.prototype.sourceLength should comprise the entire script (excluding
 * arguments in the case of Function constructors)
 */

let g = newGlobal({newCompartment: true});
let dbg = new Debugger(g);

var count = 0;
function test(string, range) {
    dbg.onNewScript = function (script) {
        ++count;
        if (count % 2 == 0) {
            assertEq(script.sourceStart, range[0]);
            assertEq(script.sourceLength, range[1]);
        }
    }

    g.eval(string);
}

test("eval('2 * 3')", [0, 5]);
test("new Function('2 * 3')", [0, 31]);
test("new Function('x', 'x * x')", [0, 32]);
assertEq(count, 6);

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

¤ Dauer der Verarbeitung: 0.14 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.