diff options
Diffstat (limited to 'Libraries/LibJS/AST.cpp')
-rw-r--r-- | Libraries/LibJS/AST.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp index 840b29412d..2f12a49e36 100644 --- a/Libraries/LibJS/AST.cpp +++ b/Libraries/LibJS/AST.cpp @@ -39,6 +39,7 @@ #include <LibJS/Runtime/NativeFunction.h> #include <LibJS/Runtime/PrimitiveString.h> #include <LibJS/Runtime/Reference.h> +#include <LibJS/Runtime/RegExpObject.h> #include <LibJS/Runtime/ScriptFunction.h> #include <LibJS/Runtime/Shape.h> #include <LibJS/Runtime/StringObject.h> @@ -1429,6 +1430,17 @@ Value NullLiteral::execute(Interpreter&) const return js_null(); } +void RegExpLiteral::dump(int indent) const +{ + print_indent(indent); + printf("%s (/%s/%s)\n", class_name(), content().characters(), flags().characters()); +} + +Value RegExpLiteral::execute(Interpreter& interpreter) const +{ + return RegExpObject::create(interpreter.global_object(), content(), flags()); +} + void ArrayExpression::dump(int indent) const { ASTNode::dump(indent); |