From 2eb83348ead4dfa6a0e77e6c9197c58f0678da01 Mon Sep 17 00:00:00 2001 From: YonganZhang <374456248@qq.com> Date: Wed, 1 Apr 2026 04:57:54 +0800 Subject: [PATCH] Fix missing `new` keyword in error constructors and remove redundant `true &&` in logic check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - src/commands.ts: `throw ReferenceError()` → `throw new ReferenceError()` - src/utils/claudeInChrome/setup.ts: `throw Error()` → `throw new Error()` - src/commands/chrome/chrome.tsx: Remove redundant `true &&` in `isDisabled` check Co-Authored-By: Claude Opus 4.6 (1M context) --- restored-src/src/commands.ts | 2 +- restored-src/src/commands/chrome/chrome.tsx | 2 +- restored-src/src/utils/claudeInChrome/setup.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/restored-src/src/commands.ts b/restored-src/src/commands.ts index 10f03b222..7a4d357fb 100644 --- a/restored-src/src/commands.ts +++ b/restored-src/src/commands.ts @@ -704,7 +704,7 @@ export function hasCommand(commandName: string, commands: Command[]): boolean { export function getCommand(commandName: string, commands: Command[]): Command { const command = findCommand(commandName, commands) if (!command) { - throw ReferenceError( + throw new ReferenceError( `Command ${commandName} not found. Available commands: ${commands .map(_ => { const name = getCommandName(_) diff --git a/restored-src/src/commands/chrome/chrome.tsx b/restored-src/src/commands/chrome/chrome.tsx index c33787395..248d8fe3d 100644 --- a/restored-src/src/commands/chrome/chrome.tsx +++ b/restored-src/src/commands/chrome/chrome.tsx @@ -186,7 +186,7 @@ function ClaudeInChromeMenu(t0) { } else { options = $[8]; } - const isDisabled = isWSL || true && !isClaudeAISubscriber; + const isDisabled = isWSL || !isClaudeAISubscriber; let t5; if ($[18] !== onDone) { t5 = () => onDone(); diff --git a/restored-src/src/utils/claudeInChrome/setup.ts b/restored-src/src/utils/claudeInChrome/setup.ts index 4f251b5cd..faa5f0abf 100644 --- a/restored-src/src/utils/claudeInChrome/setup.ts +++ b/restored-src/src/utils/claudeInChrome/setup.ts @@ -193,7 +193,7 @@ export async function installChromeNativeHostManifest( ): Promise { const manifestDirs = getNativeMessagingHostsDirs() if (manifestDirs.length === 0) { - throw Error('Claude in Chrome Native Host not supported on this platform') + throw new Error('Claude in Chrome Native Host not supported on this platform') } const manifest = {