Files
ladybird/Libraries/LibJS
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
..
2020-06-07 19:29:40 +02:00
2020-06-07 19:29:40 +02:00
2020-06-07 19:29:40 +02:00
2020-06-07 19:29:40 +02:00
2020-06-07 19:29:40 +02:00
2020-06-07 19:29:40 +02:00
2020-06-07 19:29:40 +02:00