let globalDecCalled = false; function globalDec(value, context) {
globalDecCalled = true;
assertEq(this, globalThis);
}
// Forward declare c to be able to check it inside of C when running decorators.
let c;
let classDecCalled = false; class C {
classDec(value, context) {
classDecCalled = true; // At this point, `this` is an instance of C
assertEq(c, this); returnfunction(initialValue) { // At this point, `this` is an instance of D
assertEq(thisinstanceof D, true); return initialValue;
}
}
}
c = new C();
class D {
@globalDec x1;
@c.classDec x2;
}
let d = new D();
assertEq(globalDecCalled, true);
assertEq(classDecCalled, true);
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
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.