diff options
author | 2023-02-22 19:07:27 -0800 | |
---|---|---|
committer | 2023-02-22 19:07:27 -0800 | |
commit | 2a1558e4d6fc2e7abbb9a6f4abc3cc4bb2d49c59 (patch) | |
tree | 62c4562c4a86b90e8456657ebecd2a416d06721d /src/bun.js/node/node.classes.ts | |
parent | 0911bd3af2aceca487f3159f20c0400fb45bdc92 (diff) | |
download | bun-2a1558e4d6fc2e7abbb9a6f4abc3cc4bb2d49c59.tar.gz bun-2a1558e4d6fc2e7abbb9a6f4abc3cc4bb2d49c59.tar.zst bun-2a1558e4d6fc2e7abbb9a6f4abc3cc4bb2d49c59.zip |
[breaking] Return Node.js `Timeout` objects in `setTimeout`, `setInterval`, and `setImmediate`
Fixes #2129 #880
Diffstat (limited to 'src/bun.js/node/node.classes.ts')
-rw-r--r-- | src/bun.js/node/node.classes.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/bun.js/node/node.classes.ts b/src/bun.js/node/node.classes.ts index 14a9ebbc5..5bebabe72 100644 --- a/src/bun.js/node/node.classes.ts +++ b/src/bun.js/node/node.classes.ts @@ -2,6 +2,33 @@ import { define } from "../scripts/class-definitions"; export default [ define({ + name: "Timeout", + construct: false, + noConstructor: true, + finalize: true, + configurable: false, + klass: {}, + JSType: "0b11101110", + proto: { + ref: { + fn: "doRef", + length: 0, + }, + unref: { + fn: "doUnref", + length: 0, + }, + hasRef: { + fn: "hasRef", + length: 0, + }, + ["@@toPrimitive"]: { + fn: "toPrimitive", + length: 1, + }, + }, + }), + define({ name: "Stats", construct: true, finalize: true, |