ScriptRuntime
The runtime method collection. Phase 0 ports only what the lexer needs: line terminator and whitespace classification, string-to-number parsing, and the error message lookup. The rest of the file arrives with Phase 3.
Types
What a call site needs: the callee and the this it goes with.
A property key resolved to either a string name or an array index, never both.
Properties
Functions
Int plus Int, falling back to a double on overflow.
The + operator: string concatenation when either side is a string, addition otherwise.
Adds to the instruction budget and tells the context when the threshold is crossed.
The next index to try after an empty match. In unicode mode a surrogate pair counts as one step, so an empty match never lands between the two halves.
Function.prototype.apply and call, which differ only in how the arguments arrive.
Finds the object in the scope chain that holds id, for an assignment. Null if none does.
Calls obj[Symbol.iterator]().
A call to eval or With, which get special treatment when they are the real ones.
The number a property name stands for when it is a canonical numeric index, or null. A typed array treats those names as element positions and everything else as ordinary properties.
The numeric half, where each side is already a number or a bigint.
Runs callable as the outermost call, setting up and tearing down the top scope around it.
Escapes a string for printing inside an object or array literal. Not quite the same as the escape builtin: control characters become the short escapes where they exist and hex escapes otherwise.
Direct eval: compiles the string in the caller's scope.
The elements of an array-like object, with holes read as undefined.
The constructor named constructorName in scope, or a failure explaining why not.
obj[elem], giving undefined where the property is missing.
The regexp engine, built on first use. Upstream discovers it through a service loader so the regexp package can be left out of a build; there is one implementation here and no service loader in common Kotlin, so it is simply constructed (D-44).
The frozen strings object a tagged template passes to its tag, built once per call site.
If str is an array index, returns it as a value in 0..2^32-1. Otherwise returns -1. Leading zeroes and "-0" are not indexes.
Puts a declared function into the scope it belongs to.
Puts a script's declared variables into scope before it runs.
Builds the global scope.
True when an iterator result object says the iteration is over.
Builds an array from a literal's values, with skipIndices naming the holes.
Converts a number to its ECMAScript string form.
A number or a bigint, read as a double. This is what upstream got for free from Number.doubleValue() before bigints stopped being Number (D-54).
Makes the enumeration hand back Int indices rather than their string form.
Throws an error of a named constructor found in scope, the way a builtin would build it.
The legacy __iterator__ protocol. Null when the object does not use it.
ToObject: wraps a primitive in its object, and refuses null and undefined.
ToPrimitive: turns an object into a primitive, asking Symbol.toPrimitive first and falling back to the object's own getDefaultValue.
Works out whether id names an array index or an ordinary property.
Builds the script-visible error object for a Java-side exception. javaException and rhinoException are LiveConnect properties and are not ported.
Boxes a double, sharing one NaN.