mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
a10d09faba
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. |
||
---|---|---|
.. | ||
LibAudio | ||
LibC | ||
LibChess | ||
LibCompress | ||
LibCore | ||
LibCpp | ||
LibCrypt | ||
LibCrypto | ||
LibDebug | ||
LibDesktop | ||
LibDiff | ||
LibELF | ||
LibGemini | ||
LibGfx | ||
LibGUI | ||
LibHTTP | ||
LibImageDecoderClient | ||
LibIPC | ||
LibJS | ||
LibKeyboard | ||
LibLine | ||
LibM | ||
LibMarkdown | ||
LibPCIDB | ||
LibProtocol | ||
LibPthread | ||
LibTar | ||
LibTextCodec | ||
LibThread | ||
LibTLS | ||
LibUnwind | ||
LibVT | ||
LibWeb | ||
LibX86 | ||
CMakeLists.txt |