serenity/Libraries
Linus Groh a10d09faba LibJS: Tweak generated source in 'new Function()' to match ES 2015 spec
ES 5(.1) described parsing of the function body string as:

https://www.ecma-international.org/ecma-262/5.1/#sec-15.3.2.1

7. If P is not parsable as a FormalParameterList[opt] then throw a SyntaxError exception.
8. If body is not parsable as FunctionBody then throw a SyntaxError exception.

We implemented it as building the source string of a complete function
and feeding that to the parser, with the same outcome. ES 2015+ does
exactly that, but with newlines at certain positions:

https://tc39.es/ecma262/#sec-createdynamicfunction

16. Let bodyString be the string-concatenation of 0x000A (LINE FEED), ? ToString(bodyArg), and 0x000A (LINE FEED).
17. Let prefix be the prefix associated with kind in Table 49.
18. Let sourceString be the string-concatenation of prefix, " anonymous(", P, 0x000A (LINE FEED), ") {", bodyString, and "}".

This patch updates the generated source string to match these
requirements. This will make certain edge cases work, e.g.
'new Function("-->")', where the user supplied input must be placed on
its own line to be valid syntax.
2020-10-29 22:27:55 +01:00
..
LibAudio LibAudio: Use new format functions. 2020-10-17 23:20:31 +02:00
LibC CMake: Use CONFIGURE_DEPENDS in existing globs. 2020-10-29 11:52:47 +01:00
LibChess LibChess: Use new format functions. 2020-10-17 23:20:31 +02:00
LibCompress Everywhere: Fix typos 2020-10-02 16:03:17 +02:00
LibCore LibCore: IODevice::can_read_line() should succeed for newline-less file 2020-10-25 14:38:07 +01:00
LibCpp LibCpp: Add library for working with c++ code 2020-09-30 21:46:59 +02:00
LibCrypt
LibCrypto Everywhere: Redundant inline specifier on constexpr functions (#3807) 2020-10-20 18:08:13 +02:00
LibDebug Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
LibDesktop Meta+LibC through LibHTTP: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
LibDiff
LibELF Everywhere: Fix more typos 2020-10-03 12:36:49 +02:00
LibGemini LibGemini: Improve rendering of <pre> blocks 2020-10-06 20:29:11 +02:00
LibGfx LibGUI+LibGfx+WindowServer: Auto-generate disabled action icons :^) 2020-10-27 21:25:40 +01:00
LibGUI LibGUI: IconView was hard-coding column 0 instead of model_column() 2020-10-28 21:41:51 +01:00
LibHTTP ProtocolServer+LibWeb: Support more detailed HTTP requests 2020-09-28 11:55:26 +02:00
LibImageDecoderClient AK: Add trivial structure validation to SharedBuffer 2020-10-02 15:38:07 +02:00
LibIPC LibIPC: Handle partial messages 2020-10-25 11:37:42 +01:00
LibJS LibJS: Tweak generated source in 'new Function()' to match ES 2015 spec 2020-10-29 22:27:55 +01:00
LibKeyboard
LibLine Shell+LibLine: Support HISTCONTROL environment variable 2020-10-26 11:27:54 +01:00
LibM Meta+LibHTTP through LibWeb: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
LibMarkdown LibMarkdown: Don't parse lines starting with a space as heading 2020-10-26 19:13:19 +01:00
LibPCIDB
LibProtocol AK: Add trivial structure validation to SharedBuffer 2020-10-02 15:38:07 +02:00
LibPthread Meta+LibHTTP through LibWeb: Make clang-format-10 clean 2020-09-25 21:18:17 +02:00
LibTar Userland: tar: support extracting gzipped files 2020-10-04 00:16:40 +02:00
LibTextCodec
LibThread HackStudio: Detach from debugged process before terminating 2020-09-26 17:18:21 +02:00
LibTLS LibTLS: Treat a close_notify before agreeing on a cipher suite as a handshake failure 2020-10-26 08:59:57 +01:00
LibUnwind Everywhere: Fix typos 2020-10-02 16:03:17 +02:00
LibVT LibGfx+LibGUI+Clients: Make fonts findable by their qualified name 2020-10-25 21:18:18 +01:00
LibWeb Fonts: Rename font files consistently 2020-10-25 10:12:03 +01:00
LibX86 Everywhere: Redundant inline specifier on constexpr functions (#3807) 2020-10-20 18:08:13 +02:00
CMakeLists.txt LibTar: Create LibTar and TarStream 2020-10-04 00:16:40 +02:00