1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:27:42 +00:00
serenity/Libraries
Yonatan Goldschmidt b184f12aaf LibJS: Limit scope of 'for' loop variables
This required 2 changes:
1. In the parser, create a new variable scope, so the variable is
   declared in it instead of the scope in which the 'for' is found.
2. On execute, push the variable into the newly created block. Existing
   code created an empty block (no variables, no arguments) which
   allows Interpreter::enter_scope() to skip the creation of a new
   environment, therefore when the variable initializer is executed, it
   sets the variable to the outer scope. By attaching the variable to
   the new block, the block gets a new environment.

This is only needed for 'let' / 'const' declarations, since 'var'
declarations are expected to leak.

Fixes: #2103
2020-05-07 23:31:49 +02:00
..
LibAudio LibAudio: Use NumericLimits<T> 2020-04-15 16:58:46 +02:00
LibBareMetal AK: Add ALWAYS_INLINE, NEVER_INLINE and FLATTEN macros 2020-04-30 11:43:25 +02:00
LibC LibC: Remove ASSERT_NOT_REACHED in getrusage 2020-05-05 11:01:36 +02:00
LibCore LibCore: Add a primitive comparison function to DateTime 2020-05-07 10:23:58 +02:00
LibCrypto LibCrypto: Cache the "trimmed length" of UnsignedBigIntegers 2020-05-07 12:23:09 +02:00
LibDebug LibDebug: Parse DWARF information entries 2020-05-05 11:01:36 +02:00
LibELF LibELF: Make ELF::Loader RefCounted 2020-04-20 17:25:50 +02:00
LibGfx Misc: Replace "String(string_view)" with "string_view.to_string()" 2020-05-06 19:28:59 +02:00
LibGUI LibGUI: Properly draw the background of the selected TreeView line 2020-05-07 22:13:25 +02:00
LibHTTP LibHTTP: Actually include query parameters when serializing raw request 2020-05-05 11:19:38 +02:00
LibIPC LibIPC: Add a simple IPC::Dictionary type (String key -> String value) 2020-05-03 23:01:58 +02:00
LibJS LibJS: Limit scope of 'for' loop variables 2020-05-07 23:31:49 +02:00
LibLine LibLine: Handle ^L while in search mode 2020-05-02 11:57:21 +02:00
LibM LibM: Implement fmodf() 2020-05-02 01:23:30 +02:00
LibMarkdown LibMarkdown: Escape HTML entities in text 2020-05-05 16:18:11 +02:00
LibPCIDB Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
LibProtocol ProtocolServer: Pass HTTP response headers to the client 2020-05-03 23:01:58 +02:00
LibPthread LibPthread: Hookup abstime argument to pthread_cond_timedwait 2020-04-26 21:31:52 +02:00
LibTextCodec LibTextCodec: Start fleshing out a simple text codec library 2020-05-03 23:01:58 +02:00
LibThread AK: Add ALWAYS_INLINE, NEVER_INLINE and FLATTEN macros 2020-04-30 11:43:25 +02:00
LibTLS LibTLS: Verify server certificate expiry date 2020-05-07 10:23:58 +02:00
LibVT LibVT: Handle ctrl+arrow keys 2020-04-20 20:23:26 +02:00
LibWeb LibWeb: Add hook when a link is middle clicked 2020-05-06 21:59:29 +02:00
LibX86 LibX86: Rename build0FSlash() to build_0f_slash() 2020-05-07 12:22:36 +02:00
Makefile Build: Only look at SUBDIRS with Makefiles 2020-02-25 19:56:48 +01:00