1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-13 20:12:06 +00:00
serenity/Libraries
Linus Groh 5072d4e02d LibJS+js: Support getting last value from "_" variable
The interpreter now has an "underscore is last value" flag, which makes
Interpreter::get_variable() return the last value if:

- The m_underscore_is_last_value flag is enabled
- The name of the variable lookup is "_"
- The result of that lookup is an empty value

That means "_" can still be used as a regular variable and will stop
doing its magic once anything is assigned to it.

Example REPL session:

> 1
1
> _ + _
2
> _ + _
4
> _ = "foo"
"foo"
> 1
1
> _
"foo"
> delete _
true
> 1
1
> _
1
>
2020-06-08 14:01:31 +02:00
..
LibAudio Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibC LibC: Make sure that ioctl() requests are #defined as macros 2020-06-03 22:56:46 +02:00
LibCore LibCore: Make sure to disable notifiers when closing a socket 2020-06-08 13:58:32 +02:00
LibCrypto LibCrypto: Add bitwise operations (and/or/xor) 2020-06-07 19:29:40 +02:00
LibDebug LibDebug: Add all Dwarf v5 attributes, tags, and form enum values 2020-06-03 08:12:50 +02:00
LibDesktop LibIPC+Services: Support URL as a native IPC type 2020-06-07 22:55:33 +02:00
LibELF Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
LibGemini Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
LibGfx LibIPC+LibGfx+IPCCompiler: Drop some unused includes 2020-06-08 13:58:32 +02:00
LibGUI LibGUI: Don't scroll cursor into view while reflows are deferred 2020-06-07 21:05:05 +02:00
LibHTTP Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
LibIPC LibIPC+LibGfx+IPCCompiler: Drop some unused includes 2020-06-08 13:58:32 +02:00
LibJS LibJS+js: Support getting last value from "_" variable 2020-06-08 14:01:31 +02:00
LibKeyboard LibKeyboard: Add new library for keyboard applications 2020-06-03 21:52:40 +02:00
LibLine LibLine: Correctly handle line content overflow when on last line 2020-06-07 23:54:21 +02:00
LibM LibM: Add exp2() and exp2f() 2020-06-04 15:45:11 +02:00
LibMarkdown LibMarkdown: Change internal MD API to return OwnPtrs 2020-05-30 00:32:12 +02:00
LibPCIDB Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibProtocol ProtocolServer: Support request headers 2020-05-21 12:27:42 +02:00
LibPthread Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem" 2020-05-20 16:24:26 +02:00
LibTextCodec LibTextCodec: Improve Latin-1 decoder so it decodes everything 2020-05-27 19:52:18 +02:00
LibThread Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibTLS LibTLS: Simplify record padding logic and ASSERT more assumptions 2020-06-04 15:58:04 +02:00
LibUnwind LibUnwind: Create UnwindBase.h to capture the EH ABI in code 2020-05-14 08:50:10 +02:00
LibVT LibVT: Allow updating the window progress via an escape sequence 2020-05-30 23:00:35 +02:00
LibWeb LibJS+LibWeb: Remove a bunch of calls to Interpreter::global_object() 2020-06-08 12:25:45 +02:00
LibX86 Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
CMakeLists.txt LibKeyboard: Add new library for keyboard applications 2020-06-03 21:52:40 +02:00