Skip to main content
Version: Next (unreleased)

Divergences from TypeScript

Every row was checked on 12 Nov 2026 by running the same program with xisto and with Node 26 (type stripping). "Error" means a compile error with the code shown, unless it says run-time.

Numbers​

WhatNodexistoWhy
intdoes not exist (annotations are stripped)a 64-bit integer typeindices and counters without conversion
int / intnumbernumber (7 / 2 is 3.5)same, on purpose
int leaving ±(2^53−1), including **loses precisionrun-time errornothing silent
literal above 2^53−1roundedrounded the same wayint is JavaScript's safe integer
a[i] with i: numberacceptederror XS8082an index is an int
-0 in a reassigned int variable or int[] element-00kept elsewhere
5 & trueconvertserror XS8115no conversions

Empty values​

WhatNodexistoWhy
undefineda valueread as null, warning XS2101one empty value
absent optional field === nullfalsetrueabsent reads as null; use == null
Map.get of a missing keyundefinednull; for an int value a run-time errorno undefined
field missing on an anyundefinednull
x!, x as T, base as Subtrustedchecked: TypeErrornothing silent
arr[i], bytes[i] out of boundsundefinedrun-time error (catchable)

Conditions and operators​

WhatNodexistoWhy
1 == "1"trueerror XS8148== is === when nothing converts
if (n), n: numbertruthinesserror XS8022 (accepted with --tsc-checked)NaN hides there
if (n), n: inttruthinessn !== 0, warning XS2105
s && x with non-booleansone of the operandsa boolean
"n=" + ntexttext, warning XS2106

Strings, collections, dates​

WhatNodexistoWhy
s.length, slice, indexOfUTF-16 unitscode points ("héllo👋".length is 6, Node 7)UTF-8 strings
s[i]a charactererror XS6033use s.slice(i, i + 1)
s.match("text")converts to a RegExperror XS7096no implicit conversion
s.normalize("NFD")decomposesreturns the string unchangedno Unicode tables
m.keys(), m.values()iteratorsarrays
m.set(new, …) inside for…of over mthe loop sees itthe loop does not see it
numbers.sort() without comparatorsorts as stringserror XS7089 (strings sort as on Node)the default surprises
const a = []any[]error XS3008a type is needed
new Date("bad").getFullYear()NaN0getters return int
Date.toString() zone name(Brasilia Standard Time)(-03)no ICU data
JSON.parse(t) as T with a Date fieldthe field stays a stringa Datethe declared type is decoded
execSync(cmd) without encodingBufferstring

Functions, modules, classes​

WhatNodexistoWhy
bare f(); of an async functionruns to its first awaitruns to the endno promise unless kept
function that can reach its end without returnallowederror XS8058
throw "text"allowederror XS8005only objects can be thrown
catch (e)unknownError
class object passed as a data interfacethe same objecta copyfixed layouts
class object passed as a method interface without implementsthe same objectan adapter: === differs
yield inside try … finallyallowederror XS6011
import "./x.ts"runs the moduledoes not run its top level
import … from "node:fs"Nodeerror XS4001 unless --node-compatit is not Node
top-level value read across a circular import too earlyReferenceErrorreads it

No longer divergent​

Earlier versions refused these; they now behave as on Node: == without conversion, int mixed with number (warning XS2103), optional boolean/int fields, (int | null)[], regex backreferences and lookaround, extends Error, Promise.all of different types (a tuple), Buffer, string[].sort(), process.env.X.

See also​