Implement the primitive wrapper built-ins: String, Number, Boolean, and Symbol.
Scope#
String#
String()constructor and primitive coercionString.fromCharCode(),String.fromCodePoint()- Instance properties:
length - Prototype methods:
charAt,charCodeAt,codePointAt concat,slice,substring,substrindexOf,lastIndexOf,includes,startsWith,endsWithtrim,trimStart,trimEndpadStart,padEndrepeatsplit,replace,replaceAll(string pattern — RegExp patterns in RegExp issue)toLowerCase,toUpperCaseat,match,search(basic string patterns)toString,valueOf- String iteration (for...of over code points)
Number#
Number()constructor and primitive coercionNumber.isNaN(),Number.isFinite(),Number.isInteger(),Number.isSafeInteger()Number.parseInt(),Number.parseFloat()Number.EPSILON,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MAX_VALUE,Number.MIN_VALUE,NaN,Infinity- Prototype:
toString(radix),toFixed(digits),toPrecision(precision),toExponential(digits),valueOf() - Global
parseInt(),parseFloat(),isNaN(),isFinite()
Boolean#
Boolean()constructor and truthiness coercionBoolean.prototype.toString(),Boolean.prototype.valueOf()
Symbol#
Symbol(description)factory (not constructable with new)Symbol.for(key)andSymbol.keyFor(sym)(global symbol registry)- Well-known symbols:
Symbol.iterator,Symbol.toPrimitive,Symbol.toStringTag,Symbol.hasInstance Symbol.prototype.toString(),Symbol.prototype.description- Symbols as property keys
Acceptance Criteria#
- String methods produce correct results (test each)
- Number parsing and formatting work correctly
- Boolean coercion follows truthiness rules
- Symbol creation and global registry work
- Well-known symbols are defined
- Primitive auto-boxing works (e.g., "hello".length)
- Unit tests for each method
Phase 10 — JavaScript Engine (issue 9 of 15). Depends on: JS core built-ins (Object/Function/Array/Error).