From faddf3a1db6d9c8bb4106eb2259f91fe8e58b817 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 24 Mar 2020 22:03:50 +0100 Subject: 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. --- Libraries/LibJS/Token.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Libraries/LibJS/Token.h') 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, -- cgit v1.2.3