Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/xdr/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  load-nonsyntactic.js

  Sprache: JAVA
 

var nonSyntacticEnvironment = { field: 10 };

var source = `
function f() {
    function g() {
        function h() {
            // Load out of non syntactic environment.
            return field;
        }
        return h();
    }
    return g();
}

f()`

function check(before, after) {
    var code = cacheEntry(source);
    var res = evaluate(code, before);
    assertEq(res, 10);
    res = evaluate(code, after);
    assertEq(res, 10);
}


check({ envChainObject: nonSyntacticEnvironment, saveBytecodeWithDelazifications: true, },
    { envChainObject: nonSyntacticEnvironment, loadBytecode: true })


try {
    var global = newGlobal();
    global.field = 10;
    check({ envChainObject: nonSyntacticEnvironment, saveBytecodeWithDelazifications: true, },
        { global: global, loadBytecode: true })

    // Should have thrown
    assertEq(falsetrue)
catch (e) {
    assertEq(/Incompatible cache contents/.test(e.message), true);
}

try {
    check({ global: global, saveBytecodeWithDelazifications: true },
        { envChainObject: nonSyntacticEnvironment, loadBytecode: true })

    // Should have thrown
    assertEq(falsetrue)
catch (e) {
    assertEq(/Incompatible cache contents/.test(e.message), true);
}


var nonSyntacticEnvironmentTwo = { field: 10 };
check({ envChainObject: nonSyntacticEnvironment, saveBytecodeWithDelazifications: true, },
    { envChainObject: nonSyntacticEnvironmentTwo, loadBytecode: true })

Messung V0.5 in Prozent
C=92 H=83 G=87

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