mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-13 02:23:10 +08:00
17 lines
477 B
JavaScript
17 lines
477 B
JavaScript
// @scriptc/experimental — the Node.js implementation.
|
|
//
|
|
// scriptc builds lower these exports to compiler intrinsics. Under Node.js
|
|
// a LifetimeRegion is an ordinary object: run() calls its callback and
|
|
// release() does nothing, since the garbage collector reclaims what the
|
|
// program no longer references.
|
|
|
|
export class LifetimeRegion {
|
|
/** Calls `fn` and returns its result. */
|
|
run(fn) {
|
|
return fn();
|
|
}
|
|
|
|
/** Does nothing under Node.js. */
|
|
release() {}
|
|
}
|