Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/xdr/   (Browser von der Mozilla Stiftung 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
C=95 H=100 G=97

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