Created
March 6, 2024 17:47
-
-
Save JLHwung/d37168995ced3f098cf378aa9e7c87e0 to your computer and use it in GitHub Desktop.
A small stress test on decorator transforms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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