From 8371e3c086329b003a58e0f171c1b44a78681090 Mon Sep 17 00:00:00 2001 From: BorysLevytskyi Date: Wed, 10 May 2023 13:03:17 +0200 Subject: [PATCH] Commit forgotten code --- src/core/calc.test.ts | 3 +-- src/core/calc.ts | 2 +- src/index.css | 8 ++++---- src/shell/AppState.ts | 2 +- src/shell/components/HelpResultView.tsx | 6 +++--- src/shell/components/WhatsNewResultView.tsx | 2 ++ 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/core/calc.test.ts b/src/core/calc.test.ts index f87a8dc..23c8018 100644 --- a/src/core/calc.test.ts +++ b/src/core/calc.test.ts @@ -117,8 +117,7 @@ describe('calc.lshift', () => { expect(r.maxBitSize).toBe(64); expect(r.num()).toBe(-1); - const r2 = calc.or(Integer.unsigned(1123123, 32), new Integer(-1)); - expect(r2.maxBitSize).toBe(64); + expect(() => calc.or(Integer.unsigned(1123123, 32), new Integer(-1))).toThrowError('This operation cannot be applied to signed and unsigned operands of the same size') }); }); diff --git a/src/core/calc.ts b/src/core/calc.ts index f32a302..f5b8405 100644 --- a/src/core/calc.ts +++ b/src/core/calc.ts @@ -123,7 +123,7 @@ export default { _applyTwo(op1: Integer, op2: Integer, operation: (bin1:string, bin2:string) => string) : Integer { if(op1.maxBitSize == op2.maxBitSize && op1.signed != op2.signed) - throw new Error("Operator `" + operation + "` cannot be applied to signed and unsigned operands of the same size"); + throw new Error("This operation cannot be applied to signed and unsigned operands of the same size"); const [num1, num2] = equalizeSize(op1, op2); diff --git a/src/index.css b/src/index.css index ec7032b..522f087 100644 --- a/src/index.css +++ b/src/index.css @@ -17,6 +17,7 @@ code { font-size: 1.2em; font-weight: bold; } .header-cmd { color: #c5c5c5 } .mono { font-family: monospace; font-size: 1.3em } + .expressionInput { padding: 3px; outline: none; @@ -26,7 +27,7 @@ code { font-size: 1.2em; font-weight: bold; } padding-left: 15px; padding-bottom: 5px; width: 600px; - background: ragba(0, 0, 0, 0); + background: rgba(0, 0, 0, 0); } .hidden { display: none;} @@ -73,7 +74,6 @@ code { font-size: 1.2em; font-weight: bold; } .light .one { color: black; } .light .zero { color: #888; } .light .indicator { color: #ddd; } -.light .expressionInput { background: #ddd;} .light .on { color: #121212; } .light .prefix { color: #888} .light .other { color: #bbb } @@ -90,7 +90,7 @@ code { font-size: 1.2em; font-weight: bold; } /* Dark */ .dark { background: #121212; color: white;} .dark .expression { color: white;} -.dark .expressionInput { color: white; background: #555; } +.dark .expressionInput { color: white; } .dark a, .dark a:visited { color: white; } .dark .indicator { color: #555; } .dark .on { color: white; } @@ -112,7 +112,7 @@ code { font-size: 1.2em; font-weight: bold; } .midnight .header-cmd { color: #85a0ad } .midnight { background: #2c3e50; color: white } .midnight .expression { color: white;} -.midnight .expressionInput { background: #85a0ad; color: white;} +.midnight .expressionInput { color: white;} .midnight a, .dark a:visited { color: white; } .midnight .indicator { color: #85a0ad; } .midnight .on { color: white; } diff --git a/src/shell/AppState.ts b/src/shell/AppState.ts index a52ce49..65fc15b 100644 --- a/src/shell/AppState.ts +++ b/src/shell/AppState.ts @@ -1,6 +1,6 @@ import log from 'loglevel'; -const APP_VERSION = 8; +const APP_VERSION = 9; export type PersistedAppData = { emphasizeBytes: boolean; diff --git a/src/shell/components/HelpResultView.tsx b/src/shell/components/HelpResultView.tsx index 5bd681e..0e43db7 100644 --- a/src/shell/components/HelpResultView.tsx +++ b/src/shell/components/HelpResultView.tsx @@ -63,10 +63,10 @@ function HelpResultView() { BitiwseCmd no longer uses the browser's JavaScript engine for the execution of bitwise operations. It has its own calculator implementation which brings supports bitwise operations on the following signed and unsigned data types:

diff --git a/src/shell/components/WhatsNewResultView.tsx b/src/shell/components/WhatsNewResultView.tsx index 57e31ff..7d5f56e 100644 --- a/src/shell/components/WhatsNewResultView.tsx +++ b/src/shell/components/WhatsNewResultView.tsx @@ -19,6 +19,8 @@ function WhatsnewResultView() { This includes shifting an integer by the number of bytes equal to its size (spoiler: you get the same number, this is undefined behavior in C. Don't believe me? Check this link).
  • A slightly improved UI
  • +

    I'm sure there will be some bugs following such a big update. I will do my best to fix them as they are found.

    +

    Many thanks to all people that submitted issues on GitHub. Your feedback is greatly appreciated.