Add the arguments object for non-arrow functions, supporting both mapped (non-strict, simple params) and unmapped (strict or non-simple params) variants. Mapped arguments use shared Rc<RefCell<JsValue>> cells to bidirectionally alias arguments[i] with the corresponding parameter binding. Includes Symbol.iterator, callee, length, Object.prototype chain, and correct handling of duplicate parameter names. Promotes 158 test262-full tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
606 lines
25 KiB
Markdown
606 lines
25 KiB
Markdown
# JavaScript Implementation Checklist
|
|
|
|
Checked items mean the feature is implemented and working end-to-end (parse → execute → correct result). Partial support is left unchecked and called out inline.
|
|
|
|
## Phase 0: Infrastructure & Conformance
|
|
|
|
- [x] Hand-written recursive-descent parser producing AST
|
|
- [x] Tree-walking interpreter over AST
|
|
- [x] Statement limit for infinite-loop prevention (configurable, default 100,000)
|
|
- [x] Call-depth limit (configurable, default 64)
|
|
- [x] JS262 conformance harness (vendored Test262 tests, TOML manifest, pass/known_fail/skip)
|
|
- [x] Full Test262 integration (Tier 2: upstream clone, auto-generated manifest, triage tooling)
|
|
- [x] Bytecode compiler + VM (top-level bytecode compilation; function calls delegate to AST interpreter)
|
|
- [ ] Source maps support
|
|
- [ ] Cycle-detecting garbage collection (currently Rc<RefCell<>>; no cycle collection)
|
|
|
|
## Phase 1: Lexical Grammar & Tokenization
|
|
|
|
- [x] Identifiers and reserved words
|
|
- [x] Numeric literals (integers, floats, hex `0x`, octal `0o`, binary `0b`, exponential)
|
|
- [x] String literals (single/double quotes, escape sequences)
|
|
- [x] Template literal tokenization (backticks, `${expr}` interpolation)
|
|
- [x] Regular expression literal tokenization with flags
|
|
- [x] Single-line (`//`) and multi-line (`/* */`) comments
|
|
- [x] Automatic semicolon insertion (ASI)
|
|
- Current state: core ASI works; 5 known-fail edge cases remain (labeled statements, do-while ASI).
|
|
- [ ] Hashbang (`#!`) comment support
|
|
- [ ] BigInt literals (`123n`)
|
|
|
|
## Phase 2: Declarations & Scoping
|
|
|
|
- [x] `var` declarations with function-scoped hoisting
|
|
- [x] `let` declarations with block scoping
|
|
- [x] `const` declarations with block scoping
|
|
- [x] Temporal Dead Zone (TDZ) for `let`/`const`
|
|
- [x] Function declarations with hoisting
|
|
- [x] Function expressions (named and anonymous)
|
|
- [x] Arrow function expressions (`=>` with expression and block bodies)
|
|
- [x] Class declarations (constructor, methods, `extends`, `super()`, `super.method()`, static methods)
|
|
- [x] Class expressions
|
|
- [ ] Block-scoped function declarations (Annex B semantics)
|
|
- [x] `import` / `export` declarations (ES modules)
|
|
- [ ] `import()` dynamic import expressions
|
|
|
|
## Phase 3: Statements & Control Flow
|
|
|
|
- [x] Block statements with scope
|
|
- [x] `if` / `else`
|
|
- [x] `for` (C-style)
|
|
- [x] `for...in` (property enumeration)
|
|
- [x] `for...of` (iterable iteration)
|
|
- Current state: works with arrays and strings only; does not invoke the general iterator protocol.
|
|
- [x] `while` and `do...while`
|
|
- [x] `switch` / `case` with fall-through
|
|
- [x] `break` and `continue`
|
|
- [x] `try` / `catch` / `finally`
|
|
- [x] `throw` statement
|
|
- [x] Empty statements (`;`)
|
|
- [ ] Labeled statements (`label: stmt`, `break label`, `continue label`)
|
|
- [ ] `with` statement (deprecated; rejected in strict mode with SyntaxError, unsupported in sloppy mode — §3.7)
|
|
- [ ] `for await...of`
|
|
- [ ] `debugger` statement (can be a no-op, but should parse)
|
|
|
|
## Phase 4: Expressions & Operators
|
|
|
|
### 4.1 Arithmetic & Assignment
|
|
- [x] Arithmetic: `+`, `-`, `*`, `/`, `%`, `**`
|
|
- [x] Unary: `+`, `-`, `!`, `~`, `typeof`, `void`, `delete`
|
|
- [x] Increment / decrement: `++`, `--` (prefix and postfix)
|
|
- [x] Assignment: `=`
|
|
- [x] Compound assignment: `+=`, `-=`, `*=`, `/=`, `%=`, `**=`
|
|
- [x] Bitwise compound assignment: `&=`, `|=`, `^=`, `<<=`, `>>=`, `>>>=`
|
|
- [x] Logical assignment: `&&=`, `||=`, `??=`
|
|
|
|
### 4.2 Comparison & Logical
|
|
- [x] Equality: `==`, `===`, `!=`, `!==`
|
|
- [x] Relational: `<`, `>`, `<=`, `>=`
|
|
- [x] Logical: `&&`, `||`, `!`
|
|
- [x] Nullish coalescing: `??`
|
|
- [x] Conditional (ternary): `? :`
|
|
|
|
### 4.3 Bitwise
|
|
- [x] Bitwise: `&`, `|`, `^`, `~`
|
|
- [x] Shift: `<<`, `>>`, `>>>`
|
|
|
|
### 4.4 Member Access & Calls
|
|
- [x] Dot member access: `obj.prop`
|
|
- [x] Bracket member access: `obj[expr]`
|
|
- [x] Function calls: `fn(args)`
|
|
- [x] Method calls: `obj.method(args)`
|
|
- [x] `new` expressions
|
|
- Current state: works with identifier targets; `new foo.Bar()` with member expressions is not supported.
|
|
- [x] `instanceof` operator
|
|
- [x] `in` operator
|
|
- [ ] Optional chaining: `?.`
|
|
- [ ] Tagged template expressions: `` tag`str` ``
|
|
|
|
### 4.5 Spread & Destructuring (Expressions)
|
|
- [x] Spread in array literals: `[...arr]`
|
|
- [x] Spread in function calls: `fn(...args)`
|
|
- [x] Spread in object literals: `{...obj}`
|
|
- [x] Comma operator
|
|
|
|
## Phase 5: Functions
|
|
|
|
- [x] Function declarations and expressions
|
|
- [x] Arrow functions with lexical `this`
|
|
- [x] Default parameters
|
|
- [x] Rest parameters (`...args`)
|
|
- [x] `this` binding (global, method, constructor contexts)
|
|
- [x] `Function.prototype.call(thisArg, ...args)`
|
|
- [x] Closures with variable capture
|
|
- Current state: variables captured by value at definition time; mutable closure state requires specific patterns.
|
|
- [x] Recursion support
|
|
- [ ] `Function.prototype.apply(thisArg, argsArray)`
|
|
- [ ] `Function.prototype.bind(thisArg, ...args)`
|
|
- [x] `arguments` object
|
|
- [x] Generator functions (`function*` / `yield` / `yield*`)
|
|
- [x] Async functions (`async function` / `await`)
|
|
- [ ] Async generator functions (`async function*`)
|
|
- [ ] Getter / setter methods (`get prop()` / `set prop()`)
|
|
- [ ] `new.target` meta-property
|
|
|
|
## Phase 6: Classes
|
|
|
|
- [x] Class declarations and expressions
|
|
- [x] Constructor method
|
|
- [x] Instance methods
|
|
- [x] Static methods
|
|
- [x] `extends` with simple identifier targets
|
|
- [x] `super()` in constructors
|
|
- [x] `super.method()` calls
|
|
- [x] Prototype chain setup
|
|
- [ ] Class fields (public instance properties)
|
|
- [ ] Private fields (`#field`)
|
|
- [ ] Private methods (`#method()`)
|
|
- [ ] Static fields and static initialization blocks
|
|
- [ ] Computed method names (`[expr]() {}`)
|
|
- [ ] Getter / setter methods in classes
|
|
- [ ] `extends` with member expressions (`class Foo extends ns.Bar`)
|
|
|
|
## Phase 7: Destructuring & Patterns
|
|
|
|
- [x] Array destructuring: `const [a, b] = arr`
|
|
- [x] Object destructuring: `const {x, y} = obj`
|
|
- [x] Nested destructuring
|
|
- [x] Default values: `const {x = 5} = obj`
|
|
- [x] Renaming: `const {x: newX} = obj`
|
|
- [x] Rest in arrays: `const [first, ...rest] = arr`
|
|
- [x] Rest in objects: `const {a, ...rest} = obj`
|
|
- [x] Array holes: `const [a, , c] = arr`
|
|
- [x] Destructuring in function parameters
|
|
- [x] Assignment destructuring: `[a, b] = [1, 2]`
|
|
- [x] Destructuring in `for...of` / `for...in` bindings
|
|
- [ ] Computed property destructuring: `const {[expr]: val} = obj`
|
|
|
|
## Phase 8: Template Literals
|
|
|
|
- [x] Basic template literals: `` `text` ``
|
|
- [x] Expression interpolation: `` `${expr}` ``
|
|
- [x] Nested expressions
|
|
- [x] Multiline strings
|
|
- [x] Escape sequences
|
|
- [ ] Tagged templates: `` tag`str` ``
|
|
- [x] `String.raw` tag function
|
|
|
|
## Phase 9: Strict Mode
|
|
|
|
- [x] Directive prologue detection (`"use strict"`)
|
|
- [x] Function-scoped and inherited strict mode
|
|
- [x] Escape sequence guard (prevents `"use\040strict"` interpretation)
|
|
- [x] Reserved word enforcement
|
|
- [x] Duplicate parameter rejection
|
|
- [x] Non-simple parameter rejection (with defaults/rest)
|
|
- [x] `delete` identifier prohibition
|
|
- [x] `this` undefined in non-constructor strict calls
|
|
- [x] `.call()` does not coerce non-object `this`
|
|
- [x] Octal escape sequence rejection
|
|
- [x] `eval`/`arguments` binding identifier restriction (§3.7)
|
|
- [x] `with` statement rejection in strict mode (§3.7)
|
|
- [x] Legacy octal literal rejection (§3.7)
|
|
- [x] Undeclared variable assignment throws ReferenceError (§3.7)
|
|
|
|
## Phase 10: Error Types & Handling
|
|
|
|
- [x] `Error` base type with `message` and `name` properties
|
|
- [x] `TypeError`
|
|
- [x] `ReferenceError`
|
|
- [x] `SyntaxError`
|
|
- [x] `RangeError`
|
|
- [x] `EvalError`
|
|
- [x] `URIError`
|
|
- [x] Proper prototype chain for all error types
|
|
- [x] `toString()` method on errors
|
|
- [x] Constructor callable without `new`
|
|
- [x] `instanceof` checks on error types
|
|
- [ ] `Error.prototype.stack` (stack traces)
|
|
- [ ] `AggregateError` (ES2021)
|
|
|
|
## Phase 11: Object Built-in
|
|
|
|
- [x] `Object()` constructor
|
|
- [x] `Object.create(proto)`
|
|
- [x] `Object.keys(obj)`
|
|
- [x] `Object.values(obj)`
|
|
- [x] `Object.entries(obj)`
|
|
- [x] `Object.assign(target, ...sources)`
|
|
- [x] `Object.getPrototypeOf(obj)`
|
|
- [x] `Object.getOwnPropertySymbols(obj)`
|
|
- [x] `Object.prototype.toString()` (with `Symbol.toStringTag` support)
|
|
- [x] `Object.prototype.valueOf()`
|
|
- [x] `Object.prototype.hasOwnProperty(prop)`
|
|
- [x] `Object.prototype.propertyIsEnumerable(prop)`
|
|
- [x] `Object.setPrototypeOf(obj, proto)`
|
|
- [x] `Object.getOwnPropertyNames(obj)`
|
|
- [x] `Object.getOwnPropertyDescriptor(obj, prop)`
|
|
- [x] `Object.getOwnPropertyDescriptors(obj)`
|
|
- [x] `Object.defineProperty(obj, prop, descriptor)`
|
|
- [x] `Object.defineProperties(obj, descriptors)`
|
|
- [x] `Object.freeze(obj)` / `Object.isFrozen(obj)`
|
|
- [x] `Object.seal(obj)` / `Object.isSealed(obj)`
|
|
- [x] `Object.preventExtensions(obj)` / `Object.isExtensible(obj)`
|
|
- [x] `Object.is(a, b)`
|
|
- [x] `Object.fromEntries(iterable)`
|
|
- [x] `Object.hasOwn(obj, prop)` (ES2022)
|
|
- [x] `Object.prototype.isPrototypeOf(obj)`
|
|
- [ ] `Object.prototype.toLocaleString()`
|
|
|
|
## Phase 12: Array Built-in
|
|
|
|
- [x] `Array()` constructor / `new Array(len)`
|
|
- [x] `Array.isArray(value)`
|
|
- [x] `.push(...items)` / `.pop()`
|
|
- [x] `.shift()` / `.unshift(...items)`
|
|
- [x] `.slice(start, end)`
|
|
- [x] `.concat(...items)`
|
|
- [x] `.join(separator)`
|
|
- [x] `.reverse()`
|
|
- [x] `.sort(compareFn)`
|
|
- [x] `.indexOf(item, from)` / `.lastIndexOf(item, from)`
|
|
- [x] `.includes(item, from)`
|
|
- [x] `.forEach(cb, thisArg)`
|
|
- [x] `.map(cb, thisArg)`
|
|
- [x] `.filter(cb, thisArg)`
|
|
- [x] `.find(cb, thisArg)` / `.findIndex(cb, thisArg)`
|
|
- [x] `.some(cb, thisArg)` / `.every(cb, thisArg)`
|
|
- [x] `.reduce(cb, init)` / `.reduceRight(cb, init)`
|
|
- [x] `.toString()`
|
|
- [x] `.length` property (auto-maintained)
|
|
- [x] `.splice(start, deleteCount, ...items)`
|
|
- [x] `.fill(value, start, end)`
|
|
- [x] `.copyWithin(target, start, end)`
|
|
- [x] `.flat(depth)` / `.flatMap(cb, thisArg)`
|
|
- [x] `.at(index)`
|
|
- [ ] `.findLast(cb)` / `.findLastIndex(cb)` (ES2023)
|
|
- [x] `.entries()` / `.keys()` / `.values()`
|
|
- [ ] `.toLocaleString()`
|
|
- [x] `Array.from(iterable, mapFn)` / `Array.of(...items)`
|
|
- [x] `.toReversed()` / `.toSorted()` / `.toSpliced()` / `.with()` (ES2023 immutable methods)
|
|
|
|
## Phase 13: String Built-in
|
|
|
|
- [x] `String()` constructor (wrapper object via `new`)
|
|
- [x] `.charAt(index)` / `.charCodeAt(index)`
|
|
- [x] `.slice(start, end)` / `.substring(start, end)`
|
|
- [x] `.indexOf(str, from)` / `.lastIndexOf(str, from)`
|
|
- [x] `.includes(str, pos)` / `.startsWith(str, pos)` / `.endsWith(str, len)`
|
|
- [x] `.toUpperCase()` / `.toLowerCase()`
|
|
- [x] `.trim()` / `.trimStart()` / `.trimEnd()`
|
|
- [x] `.split(separator, limit)` (including regex with capture groups)
|
|
- [x] `.replace(pattern, replacement)` (string and regex patterns)
|
|
- [x] `.match(regexp)` / `.search(regexp)`
|
|
- [x] `.repeat(count)`
|
|
- [x] `.concat(...strings)`
|
|
- [x] `.toString()` / `.valueOf()`
|
|
- [x] `.length` property
|
|
- [ ] `.substr(start, length)` (legacy but widely used)
|
|
- [x] `.padStart(len, pad)` / `.padEnd(len, pad)`
|
|
- [x] `.at(index)`
|
|
- [x] `.codePointAt(index)`
|
|
- [x] `.normalize(form)` (stub)
|
|
- [x] `.matchAll(regexp)`
|
|
- [x] `.replaceAll(pattern, replacement)`
|
|
- [x] `String.fromCharCode(...codes)` / `String.fromCodePoint(...codes)`
|
|
- [ ] `.toLocaleLowerCase()` / `.toLocaleUpperCase()` / `.localeCompare()`
|
|
|
|
## Phase 14: Number Built-in
|
|
|
|
- [x] `Number()` constructor (wrapper object via `new`)
|
|
- [x] `Number.prototype.toString()`
|
|
- [x] `Number.prototype.valueOf()`
|
|
- [ ] `Number.prototype.toFixed(digits)`
|
|
- [ ] `Number.prototype.toExponential(digits)`
|
|
- [ ] `Number.prototype.toPrecision(digits)`
|
|
- [ ] `Number.prototype.toLocaleString()`
|
|
- [x] `Number.isNaN(value)`
|
|
- [x] `Number.isFinite(value)`
|
|
- [x] `Number.isInteger(value)`
|
|
- [ ] `Number.isSafeInteger(value)`
|
|
- [x] `Number.parseFloat(string)` / `Number.parseInt(string, radix)`
|
|
- [x] `Number.MAX_VALUE` / `Number.MIN_VALUE`
|
|
- [x] `Number.MAX_SAFE_INTEGER` / `Number.MIN_SAFE_INTEGER`
|
|
- [x] `Number.EPSILON`
|
|
- [x] `Number.POSITIVE_INFINITY` / `Number.NEGATIVE_INFINITY` / `Number.NaN`
|
|
|
|
## Phase 15: Boolean Built-in
|
|
|
|
- [x] `Boolean()` constructor (wrapper object via `new`)
|
|
- [x] `Boolean.prototype.toString()`
|
|
- [x] `Boolean.prototype.valueOf()`
|
|
|
|
## Phase 16: RegExp Built-in
|
|
|
|
- [x] Regex literals: `/pattern/flags`
|
|
- [x] `new RegExp(pattern, flags)` constructor
|
|
- [x] `.test(string)`
|
|
- [x] `.exec(string)` with capture groups, `index`, and `input` properties
|
|
- [x] `.toString()`
|
|
- [x] `.source` / `.flags` / `.lastIndex` properties
|
|
- [x] Flags: `g`, `i`, `m`, `s`, `u`, `y`
|
|
- [x] String integration: `.match()`, `.replace()`, `.search()`, `.split()`
|
|
- [x] Function replacers in `.replace(regexp, fn)` — replacer called with `(match, ...captures, index, fullString)`
|
|
- [ ] `.matchAll()` (returns iterator)
|
|
- [x] Named capture groups (`(?<name>...)` and `$<name>`) — supported via `regress` crate
|
|
- [ ] Lookbehind assertions (`(?<=...)` / `(?<!...)`)
|
|
- Lookahead is supported via the `regress` crate.
|
|
- [x] `RegExp.prototype[Symbol.match]` / `[Symbol.replace]` / `[Symbol.search]` / `[Symbol.split]`
|
|
- [ ] `d` flag (hasIndices)
|
|
|
|
## Phase 17: Symbol Built-in
|
|
|
|
- [x] `Symbol(description)` creation
|
|
- [x] `.description` property
|
|
- [x] `.toString()` → `"Symbol(description)"`
|
|
- [x] `Symbol.for(key)` / `Symbol.keyFor(symbol)` (global registry)
|
|
- [x] Symbol-keyed object properties
|
|
- [x] `Object.getOwnPropertySymbols(obj)`
|
|
- [x] Well-known symbols:
|
|
- [x] `Symbol.iterator`
|
|
- [x] `Symbol.toPrimitive`
|
|
- [x] `Symbol.hasInstance`
|
|
- [x] `Symbol.toStringTag`
|
|
- [x] `Symbol.species`
|
|
- [x] `Symbol.isConcatSpreadable`
|
|
- [ ] `Symbol.asyncIterator`
|
|
- [ ] `Symbol.match` / `Symbol.replace` / `Symbol.search` / `Symbol.split`
|
|
- [ ] `Symbol.toPrimitive` full hint protocol in all coercion contexts
|
|
|
|
## Phase 18: Promise
|
|
|
|
- [x] `new Promise(executor)`
|
|
- [x] `Promise.resolve(value)` / `Promise.reject(reason)`
|
|
- [x] `.then(onFulfilled, onRejected)`
|
|
- [x] `.catch(onRejected)`
|
|
- [x] Microtask queue integration
|
|
- [x] Handler chaining
|
|
- [x] Error propagation
|
|
- [ ] `.finally(onFinally)`
|
|
- [x] `Promise.all(iterable)`
|
|
- [x] `Promise.race(iterable)`
|
|
- [x] `Promise.allSettled(iterable)`
|
|
- [x] `Promise.any(iterable)` (ES2021)
|
|
- [ ] `Promise.withResolvers()` (ES2024)
|
|
|
|
## Phase 19: JSON
|
|
|
|
- [x] `JSON.stringify(value, replacer, space)`
|
|
- [x] Replacer function and array support
|
|
- [x] Space / indentation parameter
|
|
- [x] `toJSON()` method support
|
|
- [x] Circular reference detection
|
|
- [x] Boxed primitive handling
|
|
- [x] `JSON.parse(text, reviver)`
|
|
- [x] Full JSON spec compliance
|
|
- [x] Surrogate pair handling
|
|
- [x] Depth limit enforcement (512)
|
|
- [x] Reviver function support
|
|
|
|
## Phase 20: WeakMap / WeakSet / Map / Set
|
|
|
|
- [x] `WeakMap`: `new WeakMap()`, `new WeakMap(iterable)`, `.get()`, `.set()`, `.has()`, `.delete()`
|
|
- Object-key-only enforcement implemented. Iterable constructor added in §3.6.
|
|
- [x] `WeakSet`: `new WeakSet()`, `new WeakSet(iterable)`, `.add()`, `.has()`, `.delete()`
|
|
- Object-key-only enforcement. Same pointer-identity pattern as WeakMap.
|
|
- [x] `WeakRef`: `new WeakRef(target)`, `.deref()` — uses `Rc::downgrade()`/`Weak::upgrade()` for genuine weak references. TypeError on primitive target. (§3.7)
|
|
- [x] `FinalizationRegistry`: `new FinalizationRegistry(callback)`, `.register(target, heldValue, unregisterToken?)`, `.unregister(token)` — cleanup callback support with implementation-defined timing. (§3.7)
|
|
- [x] `Map`: `new Map()`, `new Map(iterable)`, `.get()`, `.set()`, `.has()`, `.delete()`, `.size`, `.forEach()`, `.entries()`, `.keys()`, `.values()`, `.clear()`
|
|
- SameValueZero key equality (NaN===NaN, +0===-0). Insertion-order preserved via `indexmap`.
|
|
- [x] `Set`: `new Set()`, `new Set(iterable)`, `.add()`, `.has()`, `.delete()`, `.size`, `.forEach()`, `.entries()`, `.keys()`, `.values()`, `.clear()`
|
|
- SameValueZero equality. Insertion-order preserved via `indexmap`.
|
|
|
|
## Phase 21: Proxy & Reflect
|
|
|
|
### Proxy
|
|
- [x] `new Proxy(target, handler)`
|
|
- [x] `Proxy.revocable(target, handler)`
|
|
- [x] Trap: `get`
|
|
- [x] Trap: `set`
|
|
- [x] Trap: `has`
|
|
- [x] Trap: `deleteProperty`
|
|
- [x] Trap: `apply` (function targets)
|
|
- [ ] Trap: `construct`
|
|
- [ ] Trap: `ownKeys`
|
|
- [ ] Trap: `getOwnPropertyDescriptor`
|
|
- [ ] Trap: `defineProperty`
|
|
- [ ] Trap: `getPrototypeOf` / `setPrototypeOf`
|
|
- [ ] Trap: `preventExtensions` / `isExtensible`
|
|
|
|
### Reflect
|
|
- [ ] `Reflect.get()` / `Reflect.set()` / `Reflect.has()`
|
|
- [ ] `Reflect.deleteProperty()` / `Reflect.apply()` / `Reflect.construct()`
|
|
- [ ] `Reflect.ownKeys()` / `Reflect.getOwnPropertyDescriptor()`
|
|
- [ ] `Reflect.defineProperty()` / `Reflect.getPrototypeOf()` / `Reflect.setPrototypeOf()`
|
|
- [ ] `Reflect.preventExtensions()` / `Reflect.isExtensible()`
|
|
|
|
## Phase 22: Missing Global Objects
|
|
|
|
### Math
|
|
- [x] Constants: `Math.PI`, `Math.E`, `Math.LN2`, `Math.LN10`, `Math.LOG2E`, `Math.LOG10E`, `Math.SQRT2`, `Math.SQRT1_2`
|
|
- [x] `Math.abs()`, `Math.ceil()`, `Math.floor()`, `Math.round()`, `Math.trunc()`
|
|
- [x] `Math.max()`, `Math.min()`
|
|
- [x] `Math.pow()`, `Math.sqrt()`, `Math.cbrt()`, `Math.hypot()`
|
|
- [x] `Math.log()`, `Math.log2()`, `Math.log10()`, `Math.exp()`, `Math.expm1()`, `Math.log1p()`
|
|
- [x] `Math.sin()`, `Math.cos()`, `Math.tan()`, `Math.asin()`, `Math.acos()`, `Math.atan()`, `Math.atan2()`
|
|
- [x] `Math.random()`, `Math.sign()`, `Math.clz32()`, `Math.fround()`, `Math.imul()`
|
|
- [x] `Math.sinh()`, `Math.cosh()`, `Math.tanh()`, `Math.asinh()`, `Math.acosh()`, `Math.atanh()`
|
|
|
|
### Date
|
|
- [x] `new Date()` / `new Date(ms)` / `new Date(string)` / `new Date(year,month,...)` / `Date.now()` / `Date.parse()` / `Date.UTC()`
|
|
- [x] Getter methods: `.getFullYear()`, `.getMonth()`, `.getDate()`, `.getDay()`, `.getHours()`, `.getMinutes()`, `.getSeconds()`, `.getMilliseconds()`, `.getTime()`, `.getTimezoneOffset()`
|
|
- [x] Setter methods: `.setFullYear()`, `.setMonth()`, `.setDate()`, `.setHours()`, `.setMinutes()`, `.setSeconds()`, `.setMilliseconds()`, `.setTime()`
|
|
- [x] UTC variants of getters and setters
|
|
- [x] `.toISOString()`, `.toJSON()`, `.toDateString()`, `.toTimeString()`, `.toLocaleDateString()`, `.toLocaleTimeString()`, `.toLocaleString()`, `.toString()`, `.valueOf()`
|
|
- Locale methods return English-only fixed format (no Intl support). Timezone defaults to UTC unless initialized by host.
|
|
|
|
### Global Functions
|
|
- [x] `parseInt(string, radix)`
|
|
- [x] `parseFloat(string)`
|
|
- [x] `isNaN(value)` / `isFinite(value)`
|
|
- [x] `encodeURI()` / `decodeURI()`
|
|
- [x] `encodeURIComponent()` / `decodeURIComponent()`
|
|
- [ ] `eval()` direct and indirect
|
|
- Current state: `eval()` is implemented with direct/indirect semantics and strict mode isolation.
|
|
|
|
## Phase 23: Iterators & Generators
|
|
|
|
### Iterator Protocol
|
|
- [x] `Symbol.iterator` invocation in `for...of`, spread, destructuring
|
|
- Generalized: `for...of` and spread now invoke `Symbol.iterator` on any object.
|
|
- [x] `IteratorResult` protocol (`{ value, done }`)
|
|
- [x] Iterator helpers: `.next()`, `.return()`, `.throw()`
|
|
- [ ] Built-in iterables: Array, String, Map (done), Set (done), TypedArray, arguments (done)
|
|
- Arrays and strings work via hardcoded fallbacks + Symbol.iterator protocol.
|
|
- [ ] `Symbol.asyncIterator` for async iteration
|
|
|
|
### Generators
|
|
- [x] `function*` declarations and expressions
|
|
- [x] `yield` expression
|
|
- [x] `yield*` delegation
|
|
- [x] Generator objects with `.next()`, `.return()`, `.throw()`
|
|
- [ ] Async generators (`async function*`)
|
|
|
|
## Phase 24: Async / Await
|
|
|
|
- [x] `async function` declarations and expressions
|
|
- [x] `async` arrow functions
|
|
- [x] `await` expression
|
|
- [x] `async` methods in classes and objects
|
|
- [ ] `for await...of` loops
|
|
- [ ] Top-level `await` (module context)
|
|
|
|
## Phase 25: Modules (ES Modules)
|
|
|
|
- [x] `import` declarations (named, default, namespace)
|
|
- [x] `export` declarations (named, default, re-export)
|
|
- [x] `import()` dynamic import
|
|
- [x] Module resolution algorithm
|
|
- [x] Module evaluation and linking
|
|
- [ ] `import.meta`
|
|
- [ ] Top-level `await`
|
|
- [x] Circular dependency handling
|
|
|
|
## Phase 26: TypedArrays & ArrayBuffer
|
|
|
|
- [ ] `ArrayBuffer` / `SharedArrayBuffer`
|
|
- [ ] `DataView`
|
|
- [ ] TypedArray constructors: `Int8Array`, `Uint8Array`, `Uint8ClampedArray`, `Int16Array`, `Uint16Array`, `Int32Array`, `Uint32Array`, `Float32Array`, `Float64Array`, `BigInt64Array`, `BigUint64Array`
|
|
- [ ] TypedArray methods (`.set()`, `.subarray()`, `.slice()`, `.from()`, `.of()`, etc.)
|
|
- [ ] `Atomics` (for shared memory)
|
|
|
|
## Phase 27: Web APIs (Browser Integration)
|
|
|
|
### DOM Access
|
|
- [x] `document.getElementById(id)`
|
|
- [x] `document.createElement(tagName)`
|
|
- [x] `element.appendChild(child)` / `element.removeChild(child)`
|
|
- [x] `element.textContent` (get/set)
|
|
- [x] Element properties: `id`, `tagName`, `className`
|
|
- [x] Element attribute access (read/write)
|
|
- [x] `document.querySelector()` / `document.querySelectorAll()`
|
|
- [x] `document.getElementsByTagName()` / `document.getElementsByClassName()`
|
|
- [x] `element.insertBefore()` / `element.replaceChild()`
|
|
- [x] `element.innerHTML` (get/set)
|
|
- Wired to fragment parse/serialize. Inline `on*` handlers from innerHTML are not auto-registered.
|
|
- [ ] `element.outerHTML`
|
|
- [x] `element.classList` (DOMTokenList)
|
|
- [x] `element.style` (CSSStyleDeclaration)
|
|
- [ ] `element.getBoundingClientRect()`
|
|
- [x] `element.parentElement` / `element.children` / `element.nextSibling` etc.
|
|
- [x] `document.createDocumentFragment()`
|
|
- [x] `Node.cloneNode(deep)`
|
|
|
|
### Events
|
|
- [x] `addEventListener(type, listener, useCapture)`
|
|
- [x] `removeEventListener(type, listener)`
|
|
- [x] Event object: `type`, `target`, `currentTarget`, `bubbles`, `cancelable`
|
|
- [x] `event.preventDefault()` / `event.stopPropagation()`
|
|
- [x] Event bubbling and capture phases
|
|
- [x] `dispatchEvent(event)` (custom events via `new Event()`)
|
|
- [x] Keyboard events: `keydown`, `keyup`
|
|
- [x] Mouse events: `mousedown`, `mouseup`, `mousemove`, `mouseenter`, `mouseleave`
|
|
- [x] Focus events: `focus`, `blur`, `focusin`, `focusout`
|
|
- [ ] Input events: `input`, `change`
|
|
|
|
### Timers & Scheduling
|
|
- [x] `setTimeout(callback, delay)` / `clearTimeout(id)`
|
|
- [x] `queueMicrotask(callback)`
|
|
- [x] Microtask queue draining after script execution
|
|
- [x] `setInterval(callback, delay)` / `clearInterval(id)`
|
|
- [x] `requestAnimationFrame(callback)` / `cancelAnimationFrame(id)`
|
|
- Wired into render loop: callbacks flushed before each paint with DOMHighResTimeStamp.
|
|
|
|
### Window & Navigation
|
|
- [ ] `window` global object
|
|
- [ ] `window.location` / `Location` API
|
|
- [ ] `window.history` / `History` API (`pushState`, `replaceState`, `popstate`)
|
|
- [ ] `window.navigator`
|
|
- [ ] `window.innerWidth` / `window.innerHeight`
|
|
- [ ] `window.getComputedStyle(element)`
|
|
- [ ] `window.scrollTo()` / `window.scrollBy()`
|
|
|
|
### Network
|
|
- [x] `fetch()` API (string URL only; Response with `.status`, `.statusText`, `.ok`, `.url`, `.headers.get()/.has()`, `.text()`, `.json()`)
|
|
- No Request objects, custom headers/methods/body, streaming, or AbortController.
|
|
- [ ] `XMLHttpRequest`
|
|
- [ ] `WebSocket`
|
|
|
|
### Storage
|
|
- [ ] `localStorage` / `sessionStorage`
|
|
- [ ] `IndexedDB`
|
|
- [ ] `document.cookie`
|
|
|
|
### Console
|
|
- [x] `console.log(...args)`
|
|
- [x] `console.warn()` / `console.error()` / `console.info()` / `console.debug()`
|
|
- [x] `console.table()` / `console.dir()`
|
|
- [x] `console.time()` / `console.timeEnd()`
|
|
- [x] `console.assert()`
|
|
- [x] `console.count()` / `console.countReset()`
|
|
- [ ] `console.group()` / `console.groupEnd()`
|
|
|
|
## Phase 28: Additional ES2015+ Features
|
|
|
|
- [ ] `BigInt` type and operations
|
|
- [ ] Optional chaining (`?.`)
|
|
- [ ] `globalThis`
|
|
- [ ] `structuredClone()`
|
|
- [ ] `queueMicrotask()` (already in Web APIs — ensure global availability)
|
|
- [ ] Logical assignment operators (`&&=`, `||=`, `??=`)
|
|
- Current state: parsing and execution implemented.
|
|
- [ ] Private class fields and methods (`#`)
|
|
- [ ] Class static initialization blocks
|
|
- [x] `at()` method on Array, String, TypedArray
|
|
- [x] `Object.hasOwn()`
|
|
- [x] `Array.prototype.toSorted()` / `.toReversed()` / `.toSpliced()` / `.with()`
|
|
- [ ] `Error.prototype.cause`
|
|
- [ ] `RegExp` match indices (`d` flag)
|
|
|
|
## Phase 29: Property Descriptors & Meta-Object Protocol
|
|
|
|
- [x] Property descriptors (`writable`, `enumerable`, `configurable`)
|
|
- [x] `Object.defineProperty()` / `Object.getOwnPropertyDescriptor()`
|
|
- [ ] Accessor properties (getters/setters via descriptors)
|
|
- [x] `Object.freeze()` / `Object.seal()` / `Object.preventExtensions()`
|
|
- [ ] Non-configurable / non-writable property enforcement
|
|
- [ ] `[[Prototype]]` chain with proper property lookup semantics
|
|
- Current state: prototype chain lookup works for basic get; descriptor-level semantics are missing.
|
|
|
|
## Phase 30: Eval
|
|
|
|
- [x] Direct `eval()` with scope access
|
|
- [x] Indirect `eval()` with global scope
|
|
- [x] Strict mode isolation in eval
|
|
- [x] Parse error handling as `SyntaxError`
|
|
- [ ] `new Function(args, body)` constructor
|
|
|
|
## Phase 31: Conformance Exit Criteria
|
|
|
|
- [ ] Pass Test262 conformance targets (define threshold per feature area)
|
|
- [x] No crashers: malformed JS must not crash the engine
|
|
- [ ] All known failures have linked issues and documented spec rationale
|
|
- [x] ~~`Math`~~, ~~`Date`~~, ~~`Map`~~, ~~`Set`~~ built-ins implemented (Date, Map, Set done in §3.6; Math done in §3.10)
|
|
- [ ] Iterator protocol fully integrated with `for...of`, spread, and destructuring
|
|
- [ ] Property descriptor model implemented (required by many libraries)
|
|
- [ ] Publish JavaScript conformance report with pass rates and remaining gaps
|