mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
* Compile Effect generators statically * test: declare the dormant array write's expected fence
15 lines
499 B
JavaScript
15 lines
499 B
JavaScript
import * as core from "./base.js";
|
|
function derive(suffix) {
|
|
return class extends core.Base {
|
|
constructor(message) { super(message); }
|
|
describe() { return super.describe() + suffix; }
|
|
};
|
|
}
|
|
const First = derive("!");
|
|
const Second = derive("?");
|
|
const first = new First("one");
|
|
const second = new Second("two");
|
|
console.log(first.describe(), second.describe());
|
|
console.log(first instanceof core.Base, first instanceof Error);
|
|
console.log(first instanceof First, first instanceof Second);
|