summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Token.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-24 22:03:50 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-24 22:21:58 +0100
commitfaddf3a1db6d9c8bb4106eb2259f91fe8e58b817 (patch)
treead93acf4f78d132e27259fc4ef5109e3266f9efe /Libraries/LibJS/Token.h
parentdb024a9cb147731cfb14ef60a862a3e392eedc9b (diff)
downloadserenity-faddf3a1db6d9c8bb4106eb2259f91fe8e58b817.zip
LibJS: Implement "throw"
You can now throw an expression to the nearest catcher! :^) To support throwing arbitrary values, I added an Exception class that sits as a wrapper around whatever is thrown. In the future it will be a logical place to store a call stack.
Diffstat (limited to 'Libraries/LibJS/Token.h')
-rw-r--r--Libraries/LibJS/Token.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibJS/Token.h b/Libraries/LibJS/Token.h
index d278a6f4e5..880834d301 100644
--- a/Libraries/LibJS/Token.h
+++ b/Libraries/LibJS/Token.h
@@ -105,6 +105,7 @@ enum class TokenType {
Slash,
SlashEquals,
StringLiteral,
+ Throw,
Tilde,
Try,
Typeof,