ladybird/Libraries/LibJS
Linus Groh 6331d45a6f LibJS: Move checks for invalid getter/setter params to parse_function_node
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.
2020-10-20 20:27:58 +02:00
..
Heap Everywhere: Add missing <AK/TemporaryChange.h> includes 2020-10-15 23:49:53 +02:00
Runtime LibJS: Speed up IndexedPropertyIterator by computing non-empty indices 2020-10-20 08:51:41 +02:00
Tests LibJS: Unprefixed octal numbers are a syntax error in strict mode 2020-10-19 20:08:22 +02:00
AST.cpp LibJS: Fix dump() indentation of UpdateExpression with suffix operator 2020-10-19 11:31:55 +02:00
AST.h LibJS: Implement logical assignment operators (&&=, ||=, ??=) 2020-10-05 17:57:26 +02:00
CMakeLists.txt LibJS: Split Heap into per-cell-size allocators 2020-10-06 18:50:47 +02:00
Console.cpp LibJS: Move Console from Interpreter to GlobalObject 2020-09-29 21:15:06 +02:00
Console.h LibJS: Move Console from Interpreter to GlobalObject 2020-09-29 21:15:06 +02:00
Forward.h LibJS: Split Heap into per-cell-size allocators 2020-10-06 18:50:47 +02:00
Interpreter.cpp LibJS: Cache commonly used FlyStrings in the VM 2020-10-13 23:57:45 +02:00
Interpreter.h LibJS: Remove some unused Interpreter member functions 2020-10-04 23:10:07 +02:00
Lexer.cpp LibJS: Unprefixed octal numbers are a syntax error in strict mode 2020-10-19 20:08:22 +02:00
Lexer.h LibJS: Fix parsing of invalid numeric literals 2020-10-18 15:38:57 +02:00
MarkupGenerator.cpp LibJS: Unify syntax highlighting 2020-10-04 23:41:31 +02:00
MarkupGenerator.h Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
Parser.cpp LibJS: Move checks for invalid getter/setter params to parse_function_node 2020-10-20 20:27:58 +02:00
Parser.h LibJS: Move checks for invalid getter/setter params to parse_function_node 2020-10-20 20:27:58 +02:00
Token.cpp LibJS: Unify syntax highlighting 2020-10-04 23:41:31 +02:00
Token.h LibJS: Implement logical assignment operators (&&=, ||=, ??=) 2020-10-05 17:57:26 +02:00