From 93e239f6827883f03f6f9c3dc21c84995c6aceba Mon Sep 17 00:00:00 2001 From: Halil Durak Date: Thu, 19 Mar 2026 12:23:19 +0300 Subject: [PATCH] bind more ECMAScript errors --- src/browser/js/Isolate.zig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/browser/js/Isolate.zig b/src/browser/js/Isolate.zig index 32b0f7d6..08df142a 100644 --- a/src/browser/js/Isolate.zig +++ b/src/browser/js/Isolate.zig @@ -78,6 +78,21 @@ pub fn createError(self: Isolate, msg: []const u8) *const v8.Value { return v8.v8__Exception__Error(message).?; } +pub fn createRangeError(self: Isolate, msg: []const u8) *const v8.Value { + const message = self.initStringHandle(msg); + return v8.v8__Exception__RangeError(message).?; +} + +pub fn createReferenceError(self: Isolate, msg: []const u8) *const v8.Value { + const message = self.initStringHandle(msg); + return v8.v8__Exception__ReferenceError(message).?; +} + +pub fn createSyntaxError(self: Isolate, msg: []const u8) *const v8.Value { + const message = self.initStringHandle(msg); + return v8.v8__Exception__SyntaxError(message).?; +} + pub fn createTypeError(self: Isolate, msg: []const u8) *const v8.Value { const message = self.initStringHandle(msg); return v8.v8__Exception__TypeError(message).?;