From b3ff93db37b1effb7a644b8158fad148c72b4633 Mon Sep 17 00:00:00 2001 From: Harsh1925 Date: Tue, 2 Sep 2025 11:56:43 -0400 Subject: [PATCH 1/2] docs: add prerequisites and quick start example to README --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 67c0887fc5..05554d6f03 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,26 @@ To use this, set this in your VS Code settings: ```json { - "typescript.experimental.useTsgo": true + "typescript.experimental.useTsgo": true } ``` +## Quick Start + +### Prerequisites + +To use `tsgo`, make sure you have the following installed: + +- **Node.js** v20.17.x (LTS) or v22.9.x+ +- **npm** v11.5.2 +- **Go** v1.25+ +- **Rust** (latest stable, with `cargo` available in PATH) + +### Installation + +```bash +npm install @typescript/native-preview + ## What Works So Far? This is still a work in progress and is not yet at full feature parity with TypeScript. Bugs may exist. Please check this list carefully before logging a new issue or assuming an intentional change. @@ -77,3 +93,4 @@ trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies. +``` From 874263ed7e4de50a9c28d8d5590b86083cb446e1 Mon Sep 17 00:00:00 2001 From: Harsh1925 Date: Tue, 2 Sep 2025 13:26:40 -0400 Subject: [PATCH 2/2] test(jsnum): add binary/oct/hex BigInt cases incl. underscores and uppercase prefixes --- internal/jsnum/pseudobigint_test.go | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/internal/jsnum/pseudobigint_test.go b/internal/jsnum/pseudobigint_test.go index fbd2bcaacd..494c30cb03 100644 --- a/internal/jsnum/pseudobigint_test.go +++ b/internal/jsnum/pseudobigint_test.go @@ -33,6 +33,42 @@ func TestParsePseudoBigInt(t *testing.T) { // TODO(jakebailey): tests for other bases + t.Run("parse non-decimal bases (small numbers)", func(t *testing.T) { + t.Parallel() + + type tc struct { + lit string + out string + } + cases := []tc{ + // binary + {lit: "0b0n", out: "0"}, + {lit: "0b1n", out: "1"}, + {lit: "0b1010n", out: "10"}, + {lit: "0b1010_0101n", out: "165"}, + {lit: "0B1101n", out: "13"}, // uppercase prefix + + // octal + {lit: "0o0n", out: "0"}, + {lit: "0o7n", out: "7"}, + {lit: "0o755n", out: "493"}, + {lit: "0o7_5_5n", out: "493"}, + {lit: "0O12n", out: "10"}, // uppercase prefix + + // hex + {lit: "0x0n", out: "0"}, + {lit: "0xFn", out: "15"}, + {lit: "0xFFn", out: "255"}, + {lit: "0xF_Fn", out: "255"}, + {lit: "0X1Fn", out: "31"}, // uppercase prefix + } + + for _, c := range cases { + got := ParsePseudoBigInt(c.lit) + assert.Equal(t, got, c.out, "literal: %q", c.lit) + } + }) + t.Run("can parse large literals", func(t *testing.T) { t.Parallel() assert.Equal(t, ParsePseudoBigInt("123456789012345678901234567890n"), "123456789012345678901234567890") @@ -41,3 +77,4 @@ func TestParsePseudoBigInt(t *testing.T) { assert.Equal(t, ParsePseudoBigInt("0x18ee90ff6c373e0ee4e3f0ad2n"), "123456789012345678901234567890") }) } +