mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
- Compile initialized Symbol() and Symbol.for() fields, including inherited OpenTUI brands. - Share registry-key storage across modules and keep symbol slots out of string-keyed enumeration. - Refuse unstable keys and unsupported symbol-field copies.
13 lines
270 B
JavaScript
13 lines
270 B
JavaScript
const countKey = Symbol.for("scriptc.counter");
|
|
const sameCount = Symbol.for("scriptc.counter");
|
|
class Counter {
|
|
constructor() {
|
|
this[countKey] = 1;
|
|
}
|
|
bump() {
|
|
this[sameCount] += 1;
|
|
return this[sameCount];
|
|
}
|
|
}
|
|
module.exports = { Counter, countKey };
|