mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
6331d45a6f
This allows us to provide better error messages as we can point the syntax error location to the exact first invalid parameter instead of always the end of the function within a object literal or class definition. Before this change: const Foo = { set bar() {} } ^ Uncaught exception: [SyntaxError]: Object setter property must have one argument (line: 1, column: 28) class Foo { set bar() {} } ^ Uncaught exception: [SyntaxError]: Class setter method must have one argument (line: 1, column: 26) After this change: const Foo = { set bar() {} } ^ Uncaught exception: [SyntaxError]: Setter function must have one argument (line: 1, column: 23) class Foo { set bar() {} } ^ Uncaught exception: [SyntaxError]: Setter function must have one argument (line: 1, column: 21) The only possible downside of this change is that class getters/setters and functions in objects are not distinguished in the message anymore - I don't think that's important though, and classes are (mostly) just syntactic sugar anyway. |
||
---|---|---|
.. | ||
Heap | ||
Runtime | ||
Tests | ||
AST.cpp | ||
AST.h | ||
CMakeLists.txt | ||
Console.cpp | ||
Console.h | ||
Forward.h | ||
Interpreter.cpp | ||
Interpreter.h | ||
Lexer.cpp | ||
Lexer.h | ||
MarkupGenerator.cpp | ||
MarkupGenerator.h | ||
Parser.cpp | ||
Parser.h | ||
Token.cpp | ||
Token.h |