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

Quelle  this-binding-with-eval.js   Sprache: JAVA

 
function Test1() {
    this.x = 8;
    this.y = 5;
    this.z = 2;
    var o = {".this": {x: 1}};
    var res;
    with (o) {
 res = this.x + (() => this.z)() + eval("this.x + (() => this.y)()");
    }
    assertEq(res, 23);
}
new Test1();

function Test2() {
    this.x = 8;
    var o = {".this": {x: 1}};
    with (o) {
 return eval("() => this.x");
    }
}
var fun = new Test2();
assertEq(fun(), 8);

function Test3() {
    this.x = 8;
    var o = {".this": {x: 1}};
    with (o) {
 assertEq(this.x, 8);
    }
}
new Test3();

function test4() {
    var o = {".this": {x: 1}};
    with (o) {
 return () => this;
    }
}
assertEq(test4()(), this);

function test5() {
    var o = {".this": {x: 1}};
    with (o) {
 return this;
    }
}
assertEq(test5(), this);

var global = this;
evaluate("with({}) { assertEq(this, global); }");
eval("with({}) { assertEq(this, global); }");

Messung V0.5
C=79 H=94 G=86

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