summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Reference.h
AgeCommit message (Collapse)Author
2021-07-01LibJS: Drop "Record" suffix from all the *Environment record classesAndreas Kling
"Records" in the spec are basically C++ classes, so let's drop this mouthful of a suffix.
2021-06-25LibJS: Make sure to always initialize Reference::m_base_valueAndreas Kling
2021-06-25LibJS: Rename Reference methods to match the specAndreas Kling
- get -> get_value (GetValue in the spec) - put -> put_value (PutValue in the spec) Also add spec links. :^)
2021-06-25LibJS: Bring Reference records a bit closer to the ECMAScript specAndreas Kling
Our Reference class now has the same fields as the spec: - Base (a non-nullish value, an environment record, or `unresolvable`) - Referenced Name (the name of the binding) - Strict (whether the reference originated in strict mode code) - ThisValue (if non-empty, the reference represents a `super` keyword) The main difference from before is that we now resolve the environment record that a reference interacts with. Previously we simply resolved to either "local variable" or "global variable". The associated abstract operations are still largely non-conforming, since we don't yet implement proper variable bindings. But this patch should at least fix a handful of test262 cases. :^) There's one minor regression: some TypeError message strings get a little worse due to doing a RequireObjectCoercible earlier in the evaluation of MemberExpression.
2021-06-22LibJS: Remove direct argument loading since it was buggyAndreas Kling
The parser doesn't always track lexical scopes correctly, so let's not rely on that for direct argument loading. This reverts the LoadArguments bytecode instruction as well. We can bring these things back when the parser can reliably tell us that a given Identifier is indeed a function argument.
2021-06-14LibJS: Teach Reference to access call frame arguments directlyAndreas Kling
2021-06-08LibJS: Support deleting local variables with operator deleteIdan Horowitz
To make this cleaner i also moved the logic into Reference::delete_.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-02LibJS: Use empty value for Reference unresolvable state, not undefinedLinus Groh
This fixes an issue where `undefined.foo = "bar"` would throw a ReferenceError instead of a TypeError as undefined was also used for truly unresolvable references (e.g. `foo() = "bar"`). I also made the various error messages here a bit nicer, just "primitive value" is not very helpful.
2021-03-21LibJS: Avoid unnecessary FlyString(String) churn in Reference ctorsAndreas Kling
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling