From 89b49bdb07e57940d64fce025c5a82f3060dc614 Mon Sep 17 00:00:00 2001 From: Boshen Date: Wed, 9 Aug 2023 11:29:28 +0800 Subject: [PATCH] doc(ast): document why Directive.directive is a raw string --- crates/oxc_ast/src/ast/js.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 6e4362239..909f6f6dd 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -922,7 +922,9 @@ pub struct Directive { #[cfg_attr(feature = "serde", serde(flatten))] pub span: Span, pub expression: StringLiteral, - // directives should always use the unescaped raw string + /// A Use Strict Directive is an ExpressionStatement in a Directive Prologue whose StringLiteral is either of the exact code point sequences "use strict" or 'use strict'. + /// A Use Strict Directive may not contain an EscapeSequence or LineContinuation. + /// pub directive: Atom, }