Skip to content

Instantly share code, notes, and snippets.

@JLHwung
Created March 6, 2024 17:47
Show Gist options
  • Save JLHwung/d37168995ced3f098cf378aa9e7c87e0 to your computer and use it in GitHub Desktop.
Save JLHwung/d37168995ced3f098cf378aa9e7c87e0 to your computer and use it in GitHub Desktop.
A small stress test on decorator transforms
class CaptureFactory {
static *id(fn) {
yield fn;
}
}
function dummy() {}
class C {}
class A extends CaptureFactory {
static #X = "A#X";
static *[Symbol.iterator]() {
@(function () { return C }) class B {
static #X = "C#X";
@(yield* super.id((_) => _.#X), dummy) accessor #accessor;
};
}
}
// It should print C#X
console.log([...A][0](C))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment