Repository navigation
Conversation
…nstanceof Symbol values are heap cells (one per Symbol, so identity is equality), the 13 well-known ones made with the VM; a Symbol is a property key through clazel-js-heap's symbol contract (Y4), which the interner never collides with. typeof, ToPropertyKey, ToString/ToNumber (TypeError), ToObject, IsLooselyEqual, SetFunctionName of a computed method key and ToPrimitive's @@toPrimitive now see them; own_properties stays String-keyed and own_symbol_properties lists the rest. The ops GetIterator, IterNext, IterClose (§7.4), ForInIterator (§14.7.5.9), CallSpread, NewSpread, InstanceOf (§13.10.2 with @@hasInstance and OrdinaryHasInstance), ToObject and ThrowIfNotObject run. An Iterator Record is a heap cell only registers hold. The iterators themselves are built-ins, so a bare VM has nothing iterable. The built-ins runner classes a missing eval reported inside a test's own Test262Error, and lists 10.1.1-11-s.js (reached now that instanceof runs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Symbol (§20.4) with Symbol.for/keyFor, the well-known symbols and Symbol.prototype; %Iterator.prototype%, the Array and String iterators (§23.1.5, §22.1.5); Function.prototype[@@hasInstance]; @@toStringTag in Object.prototype.toString and on Math, JSON and the iterator prototypes; Object.prototype.toLocaleString. Array: from, at, copyWithin, entries, keys, values (= @@iterator), findLast, findLastIndex, flat, flatMap, toLocaleString, toReversed, toSorted, toSpliced, with, @@unscopables; concat reads @@isConcatSpreadable and ArraySpeciesCreate reads @@species (the constructor itself while get Array[@@species], an accessor, is missing). Spread, for-of and destructuring over arrays and strings now run end to end (tests/iteration.rs). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
String: fromCodePoint, raw, and at, codePointAt, concat, endsWith, includes, isWellFormed, lastIndexOf, localeCompare, match, matchAll, padEnd, padStart, repeat, replace, replaceAll (GetSubstitution), search, split, startsWith, toLowerCase/toUpperCase (and the locale forms), toWellFormed, trim, trimEnd, trimStart, @@iterator, and Annex B substr, trimLeft, trimRight. The RegExp-taking methods delegate to a pattern's @@match/@@replace/... and are NotYet otherwise (no RegExp yet). Number: toExponential, toPrecision (clazel-js-number) and toLocaleString. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Installing the built-ins grew with Symbol, the iterators and String (about 25 s a case under Miri), so builtins.rs takes the stride the other built-in tests use, which keeps each test well under xtask's 300 s limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
atiernan
requested a deployment
to
full-verification
November 23, 2026 05:14 — with
GitHub Actions
Waiting
Member
Author
|
Contained in #299 (Promise, RegExp), which was cut from this branch. Branch kept. |
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 7 item 7.9 (built-ins), the next slice: Symbols and the iterator protocol in the VM, so spread,
for-ofand destructuring run end to end;Symbol; the Array and String iterators; most ofString.prototype; the rest ofNumber.prototype; and the rest ofArray.prototype. Base:claude/phase7-integration(#286).What landed
clazel-js-vm(commit 1)Vm::newwith ids 0 to 12, asclazel-js-heap's symbol contract (Y1) numbers them. A Symbol is a property key through the contract's Y4 encoding (top bit set), which the string interner never reaches.typeof("symbol"), ToPropertyKey (§7.1.19, also theToPropertyKeyop, so computed keys work), ToString/ToNumber (TypeError), ToObject (Symbol wrapper), IsLooselyEqual (steps 1 and 14), SetFunctionName of a computed method key ([desc]),[[Get]]on a Symbol primitive.Heap::own_propertiesstays String-keyed (every existing caller wants that);own_symbol_propertieslists the rest.@@toPrimitive(§7.1.1 step 1.b).GetIterator,IterNext,IterClose(§7.4 GetIterator/GetIteratorFromMethod, IteratorStepValue, IteratorClose),ForInIterator(§14.7.5.9),CallSpread,NewSpread,InstanceOf(§13.10.2 with@@hasInstance, OrdinaryHasInstance §7.3.21),ToObject,ThrowIfNotObject. An Iterator Record is a heap cell only registers hold. Public helpers for natives:get_iterator,get_iterator_from_method,iterator_step_value,iterator_close,iterator_close_on_throw,iterator_to_list,new_symbol,well_known_symbol,instance_of, ...clazel-js'sScope::kindreportsValueKind::Symbol(one line; nothing else in the embedding API changed).clazel-js-builtins(commits 2 and 3)Symbol(§20.4): constructor (notnew-able),Symbol.for/keyFor, the well-known symbols,Symbol.prototype.toString,valueOf,@@toPrimitive,@@toStringTag.%Iterator.prototype%[@@iterator],%ArrayIteratorPrototype%.next,%StringIteratorPrototype%.next(code points), CreateIterResultObject.Function.prototype[@@hasInstance];Object.prototype.toStringreads@@toStringTag;Object.prototype.toLocaleString;@@toStringTagonMath,JSONand the iterator prototypes.Array:from(iterable and array-like),at,copyWithin,entries,keys,values(=@@iterator),findLast,findLastIndex,flat,flatMap,toLocaleString,toReversed,toSorted,toSpliced,with,@@unscopables;concatreads@@isConcatSpreadable, ArraySpeciesCreate reads@@species.String:fromCodePoint,raw;at,codePointAt,concat,endsWith,includes,isWellFormed,lastIndexOf,localeCompare,match,matchAll,padEnd,padStart,repeat,replace,replaceAll(GetSubstitution),search,split,startsWith,toLowerCase,toUpperCase,toLocaleLowerCase,toLocaleUpperCase,toWellFormed,trim,trimEnd,trimStart,@@iterator; Annex Bsubstr,trimLeft,trimRight(same function objects astrimStart/trimEnd).String(sym)gives SymbolDescriptiveString.Number.prototype:toExponential,toPrecision(overclazel-js-number),toLocaleString.§n†) and quotes the steps it covers.Tests (new, no files read, so they run under Miri at a stride of 8):
tests/iteration.rs(Symbols,instanceof, spread/for-of/destructuring including iterator closing onbreak,returnand throw, the Array and String iterators,Array.from,for-in) andtests/strings.rs(String statics and methods, GetSubstitution,split, Number, Boolean, the new Array methods,@@isConcatSpreadable,@@species).Test262 (the vendored suite has no
built-ins/directory, so this moves little)conformance_builtins(with the built-ins): pass 545 → 552, fail 0 (xfail 4667 → 4660).conformance_interp(bare VM): pass 456 → 457, fail 0.language/directive-prologue/10.1.1-11-s.js(calls the missingeval; the test catches the ReferenceError and assertserr instanceof SyntaxError, reached now thatinstanceofruns). The classifier now also recognises a missing global reported inside a test's own Test262Error message (... Actual: ReferenceError: eval is not defined, 16 RegExp-literal tests reached now thatinstanceofruns); they stay expected failures under "global eval is missing".Not done
normalize(needs NFD/NFKC/NFKD data), the Annex B HTML methods of String,Iteratorand the iterator helpers, generators' prototypes,Array.fromAsync.match/matchAll/search(they delegate to a pattern's@@match/@@matchAll/@@searchand areNotYetotherwise), andreplace/replaceAll/splitwith a RegExp (they work with any pattern object that has@@replace/@@split).CreateRestArray(rest parameters): a frame keeps onlynparamsarguments, so the extra ones are not reachable yet.new_symbol,well_known_symbol,iterateandinstance_ofwith a bound function still return NotImplemented (clazel-js's contract is reviewed separately; they can now be built on the VM's public helpers).Deviations (each is also listed in the module header it belongs to)
get Array[@@species]andSymbol.prototype.descriptionare absent. ArraySpeciesCreate uses the constructor itself when it has no@@speciesproperty at all (what the missing getter would return); a script-defined@@species,nullincluded, is honoured.for-intakes its keys when the loop starts (each enumerable string key of the object and its chain once, shadowed ones left out) and skips a key no longer present when reached; keys added during the loop are not visited. §14.7.5.9 allows this.to_lowercase/to_uppercase(full Unicode Default Case Conversion with SpecialCasing and Final Sigma at the toolchain's Unicode version); lone surrogates are kept and split the text. Locale variants are the same functions.localeComparecompares code units (no ECMA-402; canonically equivalent strings do not compare equal).toLocaleStringof Number and Array usetoStringand,.Object('ab')[0]isundefined,String.raw({ raw: 'xyz' })sees no literals). Primitive strings and their iterator are right.Intrinsic::SymbolRegistry, documented as not a standard intrinsic).builtins.rsnow runs every eighth case under Miri (was every third): installing the built-ins grew (about 25 s a case under Miri) andobject_constructor_and_prototypewas already at 298 s.Verification
cargo xtask verify --changed origin/claude/phase7-integration(changed crates: clazel-js-vm, clazel-js-builtins, clazel-js, clazel-jit) ended inRESULT: FAILED, on one step only:no committed row to carry over for ["clazel-deflate", "clazel-forms", "clazel-gif", "clazel-image-shape", "clazel-jpeg", "clazel-png", "clazel-svg", "clazel-webp"]. These are the phase 6 crates merged into the base from main; the base'sdocs/STATUS.mdhas no rows for them (CI writes the table only on main), so this fails on the base too and is unrelated to this change. STATUS.md is not edited here, per CLAUDE.md.Under Miri every built-in test runs in at most 142 s (json_parse), well under the 300 s limit; the new test files take at most 105 s per test.
CI's full verification has not run yet; the proof jobs wait for a
full-verificationreviewer's approval. Not done until it is green.🤖 Generated with Claude Code