1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

LibJS: Improve error messages for primitive strict mode property access

Using ErrorType::ReferencePrimitiveSetProperty the errors for primitives
now look like "Cannot set property 'foo' of number '123'".

The strict-mode-errors test has been adjusted and re-enabled.
This commit is contained in:
Simon Wanner 2023-11-05 15:21:01 +01:00 committed by Andreas Kling
parent b9c9315bcb
commit eaf8c2e398
3 changed files with 19 additions and 15 deletions

View file

@ -23,5 +23,5 @@ test("setting new properties on a symbol is an error in strict mode", () => {
var symbol = Symbol("foo");
expect(() => {
symbol.bar = 42;
}).toThrowWithMessage(TypeError, "Cannot set property 'bar' of Symbol(foo)");
}).toThrowWithMessage(TypeError, "Cannot set property 'bar' of symbol 'Symbol(foo)'");
});