mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +08:00
- Compile JavaScript instance fields with native undefined initialization and ordered resets. - Support prefix and postfix updates to numeric static fields through exact class bindings.
20 lines
579 B
TypeScript
20 lines
579 B
TypeScript
import { Counter } from "./counter.ts";
|
|
|
|
console.log(Counter.value++, ++Counter.value, Counter.value);
|
|
console.log(Counter.value--, --Counter.value, Counter.value);
|
|
Counter.value++;
|
|
--Counter.value;
|
|
console.log(Counter.value, Counter.nextPrivate(), Counter.nextPrivate());
|
|
|
|
const Alias = Counter;
|
|
console.log(Alias.value++, Counter.value);
|
|
const Local = class {
|
|
static count = 3;
|
|
};
|
|
console.log(--Local.count, Local.count--, Local.count);
|
|
|
|
class Independent extends Counter {
|
|
static override value = 100;
|
|
}
|
|
console.log(Independent.value++, Independent.value, Counter.value);
|